import Data.List (sort) judge :: String -> Int -> String -> String judge sb n sa | n == 0 = if sb == sa then f else s | n >= 2 = if cond2 then f else s | n == 1 = if cond1 then f else s where (cb1 : cb2 : cb3 : _) = sb cond1 = sa == [cb2, cb1, cb3] || sa == [cb1, cb3, cb2] cond2 = sort sb == sort sa s = "SUCCESS" f = "FAILURE" main :: IO () main = do sb <- getLine n <- readLn sa <- getLine putStrLn $ judge sb n sa