n = 1_000_000_000 30.times do n = (n + 1) // 2 puts n STDOUT.flush r = read_line.to_i break if r == 1 end