::x::a,b=io.read("*n","*n")c=a%10print(c==a/10%10 and c or b//100)goto x