package main import f "fmt" func main(){for i:=0;i<32;i++{var a,b string f.Scan(&a,&b) g:=f.Print if a[1]==a[2]{g(a[2]-'0')}else{g(b[0]-'0')}}}