ior = io.read local s1 = ior() local num = ior("*n", "*l") local s2 = ior() local cnt1, cnt2, v1, v2 = 0, 0, 0, 0 for i = 1, 3 do if(s1:sub(i, i) == "o") then cnt1, v1 = cnt1 + 1, v1 + 2^(i-1) end if(s2:sub(i, i) == "o") then cnt2, v2 = cnt2 + 1, v2 + 2^(i-1) end end if(cnt1 ~= cnt2) then print("SUCCESS") elseif(cnt1 == 0 or cnt1 == 3) then print("FAILURE") else if(cnt1 == 2) then v1, v2 = 7 - v1, 7 - v2 end if(v1 == 1) then if(v2 == 1) then print("FAILURE") elseif(v2 == 2) then print(num == 0 and "SUCCESS" or "FAILURE") else print(num <= 1 and "SUCCESS" or "FAILURE") end elseif(v1 == 4) then if(v2 == 4) then print("FAILURE") elseif(v2 == 2) then print(num == 0 and "SUCCESS" or "FAILURE") else print(num <= 1 and "SUCCESS" or "FAILURE") end else if(v2 == 2) then print(num == 1 and "SUCCESS" or "FAILURE") else print(num == 0 and "SUCCESS" or "FAILURE") end end end