CF94B.Friends

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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.

输入格式

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

Each of the following mm lines contains two integers aia_{i} and bib_{i} (1<=ai,bi<=5;aibi)(1<=a_{i},b_{i}<=5;a_{i}≠b_{i}) , where ( ai,bia_{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 xx is acquainted with yy , then yy is also acquainted with xx .

输出格式

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

输入输出样例

  • 输入#1

    4
    1 3
    2 3
    1 4
    5 3
    

    输出#1

    WIN
    
  • 输入#2

    5
    1 2
    2 3
    3 4
    4 5
    5 1
    

    输出#2

    FAIL
    
首页