using System; using System.Linq; namespace YukicoderSource { class Program { static void Main(string[] args) { var before = Console.ReadLine(); var n = long.Parse(Console.ReadLine()); var after = Console.ReadLine(); var success = "SUCCESS"; if (before.Count(element => element.Equals('o')) != after.Count(element => element.Equals('o'))) { Console.WriteLine(success); return; } var failure = "FAILURE"; if (n >= 2) { Console.WriteLine(failure); return; } if (n == 1) { if (before.Equals(after)) { Console.WriteLine(failure); return; } if (before[1] != after[1]) { Console.WriteLine(failure); return; } Console.WriteLine(success); return; } if (before.Equals(after)) { Console.WriteLine(failure); return; } Console.WriteLine(success); } } }