#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define LOG(...) printf(__VA_ARGS__) //#define LOG(...) #define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i) #define REP(i,n) for(int i=0;i<(int)(n);++i) #define ALL(a) (a).begin(),(a).end() #define RALL(a) (a).rbegin(),(a).rend() #define EXIST(s,e) ((s).find(e)!=(s).end()) #define SORT(c) sort((c).begin(),(c).end()) #define RSORT(c) sort((c).rbegin(),(c).rend()) #define CLR(a) memset((a), 0 ,sizeof(a)) typedef long long ll; typedef unsigned long long ull; typedef vector vb; typedef vector vi; typedef vector vll; typedef vector vvb; typedef vector vvi; typedef vector vvll; typedef pair pii; typedef pair pll; const int dx[] = {-1,0,1,0}; const int dy[] = {0,1,0,-1}; int main() { string bef, aft; int coin_number = 0; int n; cin >> bef >> n >> aft; REP(i, 3){ if(bef[i] == 'o') coin_number++; if(aft[i] == 'o') coin_number--; } bool res = true; if(coin_number != 0){ goto RES; } else if(n > 1){ res = false; goto RES; } { string cng = bef; swap(cng[0], cng[1]); if(aft == cng) { res = false; goto RES; } } { string cng = bef; swap(cng[2], cng[1]); if(aft == cng) { res = false; goto RES; } } RES: cout << (res ? "SUCCESS" : "FAILURE") << endl; }