package main import."fmt" func main(){for{a,b:=0,0;Scan(&a,&b);if 0/a+b%110<9{a=b/10};Print(a%10)}}