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 JAVA):

Solution:

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.StringTokenizer;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author pttrung
 */
public class B {

    public static void main(String[] args) {
        Scanner in = new Scanner();
        PrintWriter out = new PrintWriter(System.out);
        int m = in.nextInt();
        boolean[][] data = new boolean[5][5];
        for (int i = 0; i < m; i++) {
            int a = in.nextInt() - 1;
            int b = in.nextInt() - 1;
            data[a][b] = true;
            data[b][a] = true;
        }
        boolean found = false;
        for (int i = 0; i < 5 && !found; i++) {
            for (int j = i + 1; j < 5 && !found; j++) {
                if (data[i][j]) {

                    for (int k = j + 1; k < 5 && !found; k++) {
                        if (data[i][k] && data[k][j]) {
                            found = true;
                            for (int h = k + 1; h < 5 && found; h++) {
                                if (data[i][h] && data[j][h] && data[k][h]) {
                                    found = false;
                                }
                            }
                        }
                    }
                }
            }
        }
        if (found) {
            out.println("WIN");
        } else {
            for (int i = 0; i < 5 && !found; i++) {
                for (int j = i + 1; j < 5 && !found; j++) {
                    if (!data[i][j]) {

                        for (int k = j + 1; k < 5 && !found; k++) {
                            if (!data[i][k] && !data[k][j]) {
                                found = true;
                                for (int h = k + 1; h < 5 && found; h++) {
                                    if (!data[i][h] && !data[j][h] && !data[k][h]) {
                                        found = false;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if(found){
                out.println("WIN");
            }else{
                out.println("FAIL");
            }
        }
        out.close();
    }

    public static long cal(String val) {
        long total = 0;
        for (int i = 0; i < val.length(); i++) {
            total += val.charAt(i) - '0';
        }
        return total;
    }

    public static class R implements Comparable<R> {

        String name;
        int point;

        public R(String name) {
            this.name = name;
        }

        @Override
        public int compareTo(R o) {
            if (point != o.point) {
                return -point + o.point;
            } else {
                return name.compareTo(o.name);
            }
        }
    }

    public double pow(double a, int b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        double val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val;
        } else {
            return val * val * a;
        }
    }

    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static long lcm(long a, long b) {
        return a * b / gcd(a, b);
    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() {
            // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}