#!/usr/bin/env python3
import random
n = None
random.seed(1337)

while True:
    zhivago = input()
    if zhivago == "I give up":
        break

    bot_move = int(zhivago)
    # sets the first input as the total amount of coins
    if n == None:
        n = bot_move
    else:
        n = n - bot_move
    # terminates when the total amount left is 1 or less

    move = random.randrange(1, 4)
    # updates the pile and prints the move made
    n = n - move
    print(move, flush=True)
