Codeforces Beta Round 76 (Div. 2 Only)
B
Friends
Codeforces
1300
原题
← AC →
翻译中…

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".

翻译中…

样例

Input #1
4
1 3
2 3
1 4
5 3
Output #1
WIN
InputCopy OutputCopy
Input #2
5
1 2
2 3
3 4
4 5
5 1
Output #2
FAIL
InputCopy OutputCopy
题目信息
题号
94B
时间限制
1 s
内存限制
256 MB
标签
图论
模拟
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。