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