$>.sync = true def f(n, l=-100, r=100) if (l-r).abs <= 1 r end a = [0]*3 a[n] = l puts"? #{a*' '}" lv = gets.to_i a[n] = r puts"? #{a*' '}" rv = gets.to_i c = (l+r)/2 if lv > rv f(n, c, r) else f(n, l, c) end end x = f(0) y = f(1) z = f(2) puts "! #{x} #{y} #{z}"