using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Collections; namespace Tejina_CS { class Program { static void Main(string[] args) { Solution sol = new Solution(); sol.Solve(); } } class Solution { bool[] Cba = new bool[3]; // true コインあり, false コイン無し bool[] Caa = new bool[3]; static bool[] b4 = { false, true, false }; static bool[] b5 = { true, false, true }; int N; int nb = 0, na = 0; string s = "SUCCESS", f = "FAILURE"; public void Solve() { if (nb != na) { Console.WriteLine(s); } else { switch (N) { case 0: if (BEquals(Cba, Caa)) Console.WriteLine(f); else Console.WriteLine(s); break; case 1: bool b4r = BEquals(b4, BAnd(Cba, Caa)); bool b5r = BEquals(b5, BOr(Cba,Caa)); if (b4r || b5r) Console.WriteLine(s); else Console.WriteLine(f); break; default: Console.WriteLine(f); break; } } } public Solution() { string Sbefore = rs(); N = ri(); string Safter = rs(); for (int i = 0; i < Cba.Length; i++) { if (Sbefore[i] == 'o') { Cba[i] = true; nb++; } } for (int i = 0; i < Caa.Length; i++) { if (Safter[i] == 'o') { Caa[i] = true; na++; } } } public static bool BEquals(bool[] x, bool[] y) { for (int i = 0; i < x.Length; i++) if (x[i] != y[i]) return false; return true; } public static bool[] BAnd(bool[] x, bool[] y) { bool[] ret = new bool[3]; for(int i=0; i int.Parse(e)).ToArray(); } static long[] rla() { return Console.ReadLine().Split(' ').Select(e => long.Parse(e)).ToArray(); } static double[] rda() { return Console.ReadLine().Split(' ').Select(e => double.Parse(e)).ToArray(); } } }