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 _a__i_ and _b__i_ (1 ≤ _a__i_, _b__i_ ≤ 5;_a__i_ ≠ _b__i_), where (_a__i_, _b__i_) 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_".
[samples]
Let $ G = (V, E) $ be an undirected graph with $ |V| = 5 $ vertices, representing Igor’s five friends.
Let $ E \subseteq \binom{V}{2} $ be the set of edges, where each edge $ \{a_i, b_i\} \in E $ denotes an acquaintance relation.
Let $ \bar{G} = (V, \binom{V}{2} \setminus E) $ be the complement graph, representing unacquainted pairs.
Define:
- A **clique of size 3** in $ G $: three vertices all pairwise connected by edges in $ E $.
- An **independent set of size 3** in $ G $: three vertices with no edges between them in $ E $, i.e., a clique of size 3 in $ \bar{G} $.
**Objective**:
Determine whether $ G $ contains either a clique of size 3 or an independent set of size 3.
If such a subset exists, output `"WIN"`.
Otherwise, output `"FAIL"`.
This is equivalent to checking whether the Ramsey number $ R(3,3) > 5 $, which is false — since $ R(3,3) = 6 $, every 2-coloring of $ K_5 $ contains a monochromatic $ K_3 $.
Thus, **"FAIL"** is only possible if the input graph violates the premise — but mathematically, **no such 5-vertex graph exists without a monochromatic triangle**.
Hence, the output is always `"WIN"` for any input.
But per problem statement: we are to check the given graph.
**Formal Decision Rule**:
Output `"WIN"` if $ \exists \{u,v,w\} \subseteq V $ such that either:
- $ \{u,v\}, \{v,w\}, \{w,u\} \in E $ (triangle in $ G $), or
- $ \{u,v\}, \{v,w\}, \{w,u\} \notin E $ (triangle in $ \bar{G} $).
Output `"FAIL"` otherwise.
However, by Ramsey’s theorem, **no such 5-vertex graph avoids both**.
So `"FAIL"` is mathematically impossible. But the problem asks to check the input.
Thus, algorithmically:
- Given $ m $ edges among 5 vertices, construct adjacency matrix or list.
- Enumerate all $ \binom{5}{3} = 10 $ triples of vertices.
- For each triple $ \{i,j,k\} $, count the number of edges among them in $ G $.
- If the count is 0 → independent set of size 3 → WIN.
- If the count is 3 → clique of size 3 → WIN.
- If for all 10 triples, the count is 1 or 2 → FAIL.
But again, Ramsey’s theorem says this cannot happen.
Nonetheless, per problem specification, implement the check.
**Final Formal Statement**:
Let $ V = \{1,2,3,4,5\} $, and $ E \subseteq \binom{V}{2} $ with $ |E| = m $.
Let $ \mathcal{T} = \{ T \subseteq V : |T| = 3 \} $, $ |\mathcal{T}| = 10 $.
For each $ T = \{a,b,c\} \in \mathcal{T} $, define:
$$
e_T = |\{ \{x,y\} \in E : x,y \in T \}|
$$
Then:
$$
\text{Output} =
\begin{cases}
\texttt{"WIN"} & \text{if } \exists T \in \mathcal{T} \text{ such that } e_T = 0 \text{ or } e_T = 3 \\
\texttt{"FAIL"} & \text{otherwise}
\end{cases}
$$