solve :: String -> String -> String
solve "a" "b" = "c"
solve "b" "a" = "c"
solve "a" "c" = "b"
solve "c" "a" = "b"
solve "b" "c" = "a"
solve "c" "b" = "a"
 
main = do
	a <- getLine
	b <- getLine
	print $ solve a b