for i = 0, 31, 1 do a,b = io.read("*n","*n") if a%10 == (a%100 - a%10)/10 then io.write (a%10) else io.write ((b-b%100)/100) end end