#include "bits/stdc++.h" using namespace std; int main() { string sb, sa; cin >> sb; int N; cin >> N; cin >> sa; int cnt = 0; int diff = 0; for (int i = 0; i < 3; i++) { if (sa[i] != sb[i]) diff++; if (sa[i] == 'o') cnt++; if (sb[i] == 'o') cnt--; } if (cnt != 0) cout << "SUCCESS" << endl; else if (diff != 0 && N == 0) cout << "SUCCESS" << endl; else cout << "FAILURE" << endl; }