s='';10.times{s+=10.times.max_by{|i|puts s+i.to_s;STDOUT.flush;'10 unlocked'==(t=gets.chop)&&exit;t.to_i}.to_s}