Problem: One day Igor K. stopped programming and took up math. One late autumn evening he was sitting at a table reading a book and thinking about something. 

The following statement caught his attention: "Among any six people there are either three pairwise acquainted people or three pairwise unacquainted people"

Igor just couldn't get why the required minimum is 6 people. "Well, that's the same for five people, too!" — he kept on repeating in his mind. — "Let's take, say, Max, Ilya, Vova — here, they all know each other! And now let's add Dima and Oleg to Vova — none of them is acquainted with each other! Now, that math is just rubbish!"

Igor K. took 5 friends of his and wrote down who of them is friends with whom. Now he wants to check whether it is true for the five people that among them there are either three pairwise acquainted or three pairwise not acquainted people.

Input

The first line contains an integer m (0 ≤ m ≤ 10), which is the number of relations of acquaintances among the five friends of Igor's.

Each of the following m lines contains two integers ai and bi (1 ≤ ai, bi ≤ 5;ai ≠ bi), where (ai, bi) is a pair of acquainted people. It is guaranteed that each pair of the acquaintances is described exactly once. The acquaintance relation is symmetrical, i.e. if x is acquainted with y, then y is also acquainted with x.

Output

Print "FAIL", if among those five people there are no either three pairwise acquainted or three pairwise unacquainted people. Otherwise print "WIN".

Examples

Input

4
1 3
2 3
1 4
5 3


Output

WIN


Input

5
1 2
2 3
3 4
4 5
5 1


Output

FAIL

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long N = 200005;
const long long inf = 10000000000000000;
bool prime[10000000];
void print(vector<long long> v) {
  long long i;
  for (i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << "\n";
}
void print(set<long long> s) {
  set<long long>::iterator itr = s.begin();
  for (; itr != s.end(); itr++) {
    cout << (*itr) << " ";
  }
  cout << "\n";
}
vector<long long> read(long long n) {
  long long i;
  vector<long long> arr(n, 0);
  for (i = 0; i < n; i++) cin >> arr[i];
  return arr;
}
vector<long long> read(long long n, long long k) {
  long long i;
  vector<long long> arr(n + k, 0);
  for (i = k; i < n + k; i++) cin >> arr[i];
  return arr;
}
bool isEven(long long n) {
  if (n % 2 == 0) return true;
  return false;
}
bool isOdd(long long n) {
  if (n % 2 == 1) return true;
  return false;
}
void fillPrime() {
  long long i, j;
  long long n = 1000001;
  for (i = 0; i < n; i++) {
    prime[i] = 1;
  }
  prime[0] = 0;
  prime[1] = 0;
  for (i = 2; i * i <= n; i++) {
    if (prime[i]) {
      for (j = i * i; j <= n; j += i) {
        prime[j] = 0;
      }
    }
  }
}
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  if (b == 0) return a;
  return gcd(b, a % b);
}
class Triplet {
 public:
  long long gcd;
  long long x;
  long long y;
};
Triplet extendedEuclidian(long long a, long long b) {
  if (b == 0) {
    Triplet ans;
    ans.gcd = a;
    ans.x = 1;
    ans.y = 0;
    return ans;
  }
  Triplet smallAns = extendedEuclidian(b, a % b);
  Triplet ans;
  ans.gcd = smallAns.gcd;
  ans.x = smallAns.y;
  ans.y = smallAns.x - (a / b) * smallAns.y;
  return ans;
}
long long modInv(long long a, long long m) {
  Triplet ans = extendedEuclidian(a, m);
  return (ans.x % m + m) % m;
}
long long power(long long x, long long n, long long m) {
  long long res = 1;
  x %= m;
  while (n) {
    if (n & 1) res = (res * x) % m;
    x = (x * x) % m;
    n >>= 1;
  }
  return res;
}
void solve() {
  long long t;
  cin >> (t);
  while (t--) {
    long long i, j, k, n, m, p, q, x, y;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long i, j, k, n, m, p, q, x, y;
  cin >> n;
  vector<long long> adj[6];
  for (i = 0; i < n; i++) {
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  long long way[10][3] = {{1, 2, 3}, {1, 2, 4}, {1, 2, 5}, {1, 3, 4},
                          {1, 3, 5}, {1, 4, 5}, {2, 3, 4}, {2, 3, 5},
                          {2, 4, 5}, {3, 4, 5}};
  bool ok = 0;
  for (i = 0; i < 10; i++) {
    long long a = way[i][0], b = way[i][1], c = way[i][2];
    if (find(adj[a].begin(), adj[a].end(), b) != adj[a].end() &&
        find(adj[a].begin(), adj[a].end(), c) != adj[a].end() &&
        find(adj[b].begin(), adj[b].end(), a) != adj[b].end() &&
        find(adj[b].begin(), adj[b].end(), c) != adj[b].end() &&
        find(adj[c].begin(), adj[c].end(), a) != adj[c].end() &&
        find(adj[c].begin(), adj[c].end(), b) != adj[c].end()) {
      ok = 1;
      break;
    } else if (find(adj[a].begin(), adj[a].end(), b) == adj[a].end() &&
               find(adj[a].begin(), adj[a].end(), c) == adj[a].end() &&
               find(adj[b].begin(), adj[b].end(), a) == adj[b].end() &&
               find(adj[b].begin(), adj[b].end(), c) == adj[b].end() &&
               find(adj[c].begin(), adj[c].end(), a) == adj[c].end() &&
               find(adj[c].begin(), adj[c].end(), b) == adj[c].end()) {
      ok = 1;
      break;
    }
  }
  if (ok) {
    cout << "WIN\n";
  } else {
    cout << "FAIL\n";
  }
  return 0;
}