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

Source: codeforces | Difficulty: EASY
Tags: Mathematics

Graph algorithms

Implementation


Solutions:
e = [[False] * 5 for i in range(5)]
for i in range(int(input())):
	(a, b) = map(int, input().split())
	e[a - 1][b - 1] = e[b - 1][a - 1] = True
for a in range(3):
	for b in range(a + 1, 4):
		for c in range(b + 1, 5):
			if len({e[a][b], e[a][c], e[b][c]}) == 1:
				print('WIN')
				exit()
print('FAIL')


m = int(input())
hash = {}
for i in range(5):
	hash[i + 1] = []
for i in range(m):
	(a, b) = map(int, input().split())
	hash[a].append(b)
	hash[b].append(a)
for i in range(1, 6):
	flag = 0
	for j in range(1, 6):
		if j in hash[i]:
			for k in range(1, 6):
				if k in hash[i] and k in hash[j]:
					flag = 1
					break
			if flag == 1:
				break
	if flag == 1:
		break
if flag != 1:
	for i in range(1, 6):
		flag = 0
		for j in range(1, 6):
			if j not in hash[i]:
				for k in range(1, 6):
					if k not in hash[i] and k not in hash[j] and (i != j) and (i != k) and (j != k):
						flag = 1
						break
				if flag == 1:
					break
		if flag == 1:
			break
if flag == 1:
	print('WIN')
else:
	print('FAIL')


from __future__ import division, print_function
import math
import os
import sys
from fractions import *
from sys import stdin, stdout
from io import BytesIO, IOBase
from itertools import accumulate
from collections import deque

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def inpu():
	return int(inp())
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def regularbracket(t):
	p = 0
	for i in t:
		if i == '(':
			p += 1
		else:
			p -= 1
		if p < 0:
			return False
	else:
		if p > 0:
			return False
		else:
			return True

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def reverse1(string):
	pp = ''
	for i in string[::-1]:
		pp += i
	if pp == string:
		return True
	return False

def reverse2(list1):
	l = []
	for i in list1[::-1]:
		l.append(i)
	if l == list1:
		return True
	return False

def mex(list1):
	p = max(list1) + 1
	for i in range(len(list1)):
		if list1[i] != i:
			p = i
			break
	return p

def sumofdigits(n):
	n = str(n)
	s1 = 0
	for i in n:
		s1 += int(i)
	return s1

def perfect_square(n):
	s = math.sqrt(n)
	if s == int(s):
		return True
	return False

def roman_number(x):
	if x > 15999:
		return
	value = [5000, 4000, 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
	symbol = ['F', 'MF', 'M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
	roman = ''
	i = 0
	while x > 0:
		div = x // value[i]
		x = x % value[i]
		while div:
			roman += symbol[i]
			div -= 1
		i += 1
	return roman

def soretd(s):
	for i in range(1, len(s)):
		if s[i - 1] > s[i]:
			return False
	return True

def countRhombi(h, w):
	ct = 0
	for i in range(2, h + 1, 2):
		for j in range(2, w + 1, 2):
			ct += (h - i + 1) * (w - j + 1)
	return ct

def binpow(a, b):
	if b == 0:
		return 1
	else:
		res = binpow(a, b // 2)
	if b % 2 != 0:
		return res * res * a
	else:
		return res * res

def binpowmodulus(a, b, m):
	a %= m
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % m
		a = a * a % m
		b >>= 1
	return res

def coprime_to_n(n):
	result = n
	i = 2
	while i * i <= n:
		if n % i == 0:
			while n % i == 0:
				n //= i
			result -= result // i
		i += 1
	if n > 1:
		result -= result // n
	return result

def prime(x):
	if x == 1:
		return False
	else:
		for i in range(2, int(math.sqrt(x)) + 1):
			if x % i == 0:
				return False
		else:
			return True

def luckynumwithequalnumberoffourandseven(x, n, a):
	if x >= n and str(x).count('4') == str(x).count('7'):
		a.append(x)
	elif x < 1000000000000.0:
		luckynumwithequalnumberoffourandseven(x * 10 + 4, n, a)
		luckynumwithequalnumberoffourandseven(x * 10 + 7, n, a)
	return a

def main():
	m = inpu()
	l = [0] * 5
	for _ in range(m):
		(a, b) = sep()
		l[a - 1] += 1
		l[b - 1] += 1
	if l.count(2) == 5:
		print('FAIL')
	else:
		print('WIN')
main()


import sys
input = sys.stdin.readline
m = int(input())
neigh = {1: [], 2: [], 3: [], 4: [], 5: []}
for i in range(m):
	(a, b) = map(int, input().split())
	neigh[a].append(b)
	neigh[b].append(a)
for key in neigh:
	if len(neigh[key]) != 2:
		print('WIN')
		break
else:
	print('FAIL')


class CodeforcesTask94BSolution:

	def __init__(self):
		self.result = ''
		self.m = 0
		self.edges = []

	def read_input(self):
		self.m = int(input())
		for x in range(self.m):
			self.edges.append([int(y) for y in input().split(' ')])

	def process_task(self):
		used = set()
		conngraph = [set() for x in range(5)]
		for edge in self.edges:
			used.add(str(edge))
			conngraph[edge[0] - 1].add(edge[1] - 1)
			conngraph[edge[1] - 1].add(edge[0] - 1)
		full = {1, 2, 3, 4, 0}
		nconngraph = [full - x for x in conngraph]
		has = False
		for a in range(5):
			for b in range(5):
				for c in range(5):
					if len(set([a, b, c])) == 3:
						if b in conngraph[a] and c in conngraph[a] and (a in conngraph[b]) and (c in conngraph[b]) and (b in conngraph[c]) and (a in conngraph[c]):
							has = True
						if b in nconngraph[a] and c in nconngraph[a] and (a in nconngraph[b]) and (c in nconngraph[b]) and (b in nconngraph[c]) and (a in nconngraph[c]):
							has = True
		self.result = 'WIN' if has else 'FAIL'

	def get_result(self):
		return self.result
Solution = CodeforcesTask94BSolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


n = int(input())
adj = [set() for i in range(6)]
for _ in range(n):
	(a, b) = map(int, input().split())
	adj[a].add(b)
	adj[b].add(a)
for i in range(1, 6):
	for j in adj[i]:
		for k in adj[j]:
			if i in adj[k]:
				print('WIN')
				exit()
for i in range(1, 6):
	adj[i] = {1, 2, 3, 4, 5} - adj[i] - {i}
for i in range(1, 6):
	for j in adj[i]:
		for k in adj[j]:
			if i in adj[k]:
				print('WIN')
				exit()
print('FAIL')


n = int(input())
vis = []
for i in range(5):
	vis.append(0)
for i in range(n):
	(a, b) = map(int, input().split())
	vis[a - 1] += 1
	vis[b - 1] += 1
count = 0
if vis != [2, 2, 2, 2, 2]:
	print('WIN')
else:
	print('FAIL')


m = int(input())
g = []
for i in range(6):
	g.append([])
	for j in range(6):
		g[i].append(0)
for i in range(m):
	(a, b) = tuple([int(x) for x in input().split()])
	g[a][b] = 1
	g[b][a] = 1
sumv = []
for i in range(1, 6):
	s = 0
	for j in range(1, 6):
		s += g[i][j]
	sumv.append(s)
if sumv != [2, 2, 2, 2, 2]:
	print('WIN')
else:
	print('FAIL')


def f(p):
	for a in range(1, 6):
		for b in range(a + 1, 6):
			t = b in p[a]
			for c in range(b + 1, 6):
				if t == (c in p[a]) == (c in p[b]):
					return 'WIN'
	return 'FAIL'
n = int(input())
p = [[] for i in range(6)]
for i in range(n):
	(a, b) = map(int, input().split())
	if a > b:
		p[b].append(a)
	else:
		p[a].append(b)
print(f(p))


lst = [[False] * 5 for i in range(5)]
for i in range(int(input())):
	(a, b) = [int(j) for j in input().split()]
	lst[a - 1][b - 1] = lst[b - 1][a - 1] = True
for a in range(3):
	for b in range(a + 1, 4):
		for c in range(b + 1, 5):
			if len({lst[a][b], lst[a][c], lst[b][c]}) == 1:
				print('WIN')
				exit()
print('FAIL')


def s():
	m = int(input())
	s = set((tuple(sorted(list(map(int, input().split())))) for _ in range(m)))
	for i in range(1, 4):
		for j in range(i + 1, 5):
			for k in range(j + 1, 6):
				r = ((i, j) in s) + ((j, k) in s) + ((i, k) in s)
				if r % 3 == 0:
					print('WIN')
					return
	print('FAIL')
s()


f = 0
n = 5
from collections import defaultdict
d = defaultdict(list)
m = int(input())
for i in range(m):
	(a, b) = map(int, input().split())
	a = a - 1
	b = b - 1
	d[a].append(b)
	d[b].append(a)
for i in range(n):
	for j in range(i + 1, n):
		for k in range(j + 1, n):
			if j in d[i] and k in d[j] and (k in d[i]):
				f = 1
			if j not in d[i] and k not in d[j] and (k not in d[i]):
				f = 1
if f:
	print('WIN')
else:
	print('FAIL')


import sys
m = int(sys.stdin.readline())
matrix = []
rows = [0] * 5
for _ in range(5):
	matrix.append([0] * 5)
for _ in range(m):
	line = sys.stdin.readline().split()
	(a, b) = (int(line[0]), int(line[1]))
	matrix[a - 1][b - 1] = 1
	rows[a - 1] += 1
	rows[b - 1] += 1
yes = False
for i in range(5):
	if rows[i] != 2:
		yes = True
if yes:
	print('WIN')
else:
	print('FAIL')


def main():
	n = int(input())
	if n != 5:
		print('WIN')
	else:
		relations_per_node = [0, 0, 0, 0, 0]
		for i in range(n):
			(friend1, friend2) = (int(f) for f in input().split())
			relations_per_node[friend1 - 1] += 1
			relations_per_node[friend2 - 1] += 1
		for i in range(5):
			if relations_per_node[i] != 2:
				print('WIN')
				break
		else:
			print('FAIL')
main()


def createMatrix(rowCount, colCount, dataList):
	mat = []
	for i in range(rowCount):
		rowList = []
		for j in range(colCount):
			rowList.append(dataList[rowCount * i + j])
		mat.append(rowList)
	return mat

def check_range(friends_mat):
	for i in range(2, 5):
		for j in range(0, i):
			for k in range(0, j):
				if friends_mat[i][j] == 1 and friends_mat[i][k] == 1 and (friends_mat[k][j] == 1) or (friends_mat[i][j] == 0 and friends_mat[i][k] == 0 and (friends_mat[k][j] == 0)):
					return True
	return False
alpha = [0] * 25
friends_relations = createMatrix(5, 5, alpha)
n = int(input())
while n:
	A = list(map(int, input().split()))
	row = A[0]
	col = A[1]
	friends_relations[row - 1][col - 1] = 1
	friends_relations[col - 1][row - 1] = 1
	n -= 1
if check_range(friends_relations):
	print('WIN')
else:
	print('FAIL')


import sys
from array import array

def input():
	return sys.stdin.buffer.readline().decode('utf-8')
n = int(input())
matrix = [[0] * 5 for _ in range(5)]
for (u, v) in (map(int, input().split()) for _ in range(n)):
	matrix[u - 1][v - 1] = matrix[v - 1][u - 1] = 1
for i in range(5):
	if sum((matrix[i][j] for j in range(5) if i != j)) != 2:
		print('WIN')
		exit()
print('FAIL')


m = int(input())
g = [[0] * 10 for i in range(10)]
for i in range(m):
	(a, b) = map(int, input().split())
	g[a][b] = g[b][a] = 1
for i in range(1, 6):
	for j in range(i + 1, 6):
		for k in range(j + 1, 6):
			if (g[i][j] + g[i][k] + g[j][k]) % 3 == 0:
				print('WIN')
				quit()
print('FAIL')


from collections import Counter
n = int(input())
l = []
for i in range(n):
	(x, y) = map(int, input().split())
	l.append(x)
	l.append(y)
d = Counter(l)
s1 = list(d.values())
f = True
if len(list(d.keys())) <= 4:
	print('WIN')
	exit()
for p in s1:
	if p == 1:
		print('WIN')
		f = False
		break
	elif p >= 3:
		print('WIN')
		f = False
		break
if f:
	print('FAIL')


a = [[False] * 5 for i in range(5)]
m = int(input())
for i in range(m):
	(x, y) = map(int, input().split(' '))
	x -= 1
	y -= 1
	a[x][y] = a[y][x] = True
for i in range(5):
	for j in range(5):
		if i == j:
			continue
		for k in range(5):
			if i == k or j == k:
				continue
			if a[i][j] == a[i][k] and a[i][j] == a[j][k]:
				print('WIN')
				exit(0)
print('FAIL')


import math
import sys
from collections import defaultdict
from collections import Counter
from collections import deque
import bisect
sys.setrecursionlimit(1000000)
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))
G = defaultdict(list)
Path = []

def addEdge(a, b):
	G[a].append(b)
	G[b].append(a)

def DFSUtil(node, vis):
	vis[node] = True
	Path.append(node)
	for child in G.get(node, []):
		if vis[child] == False:
			DFSUtil(child, vis)

def dfs(N):
	vis = [False for i in range(N + 1)]
	DFSUtil(1, vis)
N = int(input())
mark = {}
C = []
price = {}
for i in range(N):
	(u, v) = ilele()
	mark[u, v] = 1
	mark[v, u] = 1
	addEdge(u, v)
if N != 5:
	print('WIN')
else:
	dfs(N)
	Path.append(Path[0])
	f = 0
	for (i, j) in zip(Path, Path[1:]):
		if mark.get((i, j), -1) == -1:
			f = 1
			break
	if any((i not in Path for i in range(1, 6))):
		f = 1
	if f == 0:
		print('FAIL')
	else:
		print('WIN')


def main():
	from sys import stdin, stdout
	arr = [0 for x in range(5)]
	for _ in range(int(stdin.readline())):
		(a, b) = map(int, stdin.readline().split())
		arr[a - 1] += 1
		arr[b - 1] += 1
	if 1 in arr or 3 in arr or 0 in arr or (4 in arr):
		stdout.write('WIN\n')
	else:
		stdout.write('FAIL\n')
main()


from collections import defaultdict
n = int(input())
l = []
d = defaultdict(list)
for i in range(1, 6):
	for j in range(i + 1, 6):
		for k in range(j + 1, 6):
			l.append((i, j, k))
for i in range(n):
	(u, v) = map(int, input().split())
	d[u].append(v)
	d[v].append(u)
for i in l:
	if i[0] in d[i[1]] and i[0] in d[i[2]] and (i[1] in d[i[2]]):
		print('WIN')
		exit()
	elif i[0] not in d[i[1]] and i[0] not in d[i[2]] and (i[1] not in d[i[2]]):
		print('WIN')
		exit()
print('FAIL')


pcs = [(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)]
m = int(input())
relations = []
for _ in range(m):
	relations.append(sorted(map(int, input().split())))
result = False
for pc in pcs:
	(a, b, c) = pc
	if [a, b] in relations and [b, c] in relations and ([a, c] in relations):
		result = True
	if [a, b] not in relations and [b, c] not in relations and ([a, c] not in relations):
		result = True
if result:
	print('WIN')
else:
	print('FAIL')


m = int(input())
dp = {}
for i in range(1, 6):
	for j in range(1, 6):
		dp[i, j] = False
for _ in range(m):
	(a, b) = map(int, input().split())
	dp[a, b] = True
	dp[b, a] = True
for i in range(1, 6):
	for j in range(1, i):
		for k in range(1, j):
			if dp[i, j] == dp[j, k] == dp[i, k]:
				print('WIN')
				exit()
print('FAIL')


n = int(input())
a = {0: [], 1: [False] * 6, 2: [False] * 6, 3: [False] * 6, 4: [False] * 6, 5: [False] * 6}
for i in range(n):
	(x, y) = map(int, input().split())
	(a[x][y], a[y][x]) = (True, True)
for x in range(1, 6):
	for y in range(1, 6):
		for z in range(1, 6):
			if x != y and y != z and (z != x):
				if a[x][y] and a[y][z] and a[z][x] or (not a[x][y] and (not a[y][z]) and (not a[z][x])):
					print('WIN')
					exit()
print('FAIL')


m = int(input())
D = [[0] * 5 for i in range(5)]
for i in range(m):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	D[a][b] = 1
	D[b][a] = 1
import itertools
for c in itertools.combinations(range(5), 3):
	(u, v, w) = c
	if D[u][v] == D[v][w] and D[v][w] == D[w][u]:
		print('WIN')
		exit()
else:
	print('FAIL')


def friend(arr, n):
	cont = 0
	cont1 = 0
	cont2 = 0
	cont3 = 0
	cont4 = 0
	cont5 = 0
	cont6 = 0
	cont7 = 0
	cont8 = 0
	cont9 = 0
	cont10 = 0
	aux = 0
	arr2 = []
	if n == 5:
		for i in arr:
			for j in i:
				arr2.append(j)
				if j == 0:
					cont += 1
					if cont == 3:
						return 'WIN'
				elif j == 1:
					cont1 += 1
					if cont1 == 3:
						return 'WIN'
				elif j == 2:
					cont2 += 1
					if cont2 == 3:
						return 'WIN'
				elif j == 3:
					cont3 += 1
					if cont3 == 3:
						return 'WIN'
				elif j == 4:
					cont4 += 1
					if cont4 == 3:
						return 'WIN'
				elif j == 5:
					cont5 += 1
					if cont5 == 3:
						return 'WIN'
				elif j == 6:
					cont6 += 1
					if cont6 == 3:
						return 'WIN'
				elif j == 7:
					cont7 += 1
					if cont7 == 3:
						return 'WIN'
				elif j == 8:
					cont8 += 1
					if cont8 == 3:
						return 'WIN'
				elif j == 9:
					cont9 += 1
					if cont9 == 3:
						return 'WIN'
				else:
					cont10 += 1
					if cont10 == 3:
						return 'WIN'
		for val in range(min(arr2), max(arr2)):
			if val == 0 and cont == 1:
				aux += 1
				if aux == 3:
					return 'WIN'
			elif j == 1 and cont1 == 1:
				aux += 1
				if aux == 3:
					return 'WIN'
			elif j == 2 and cont2 == 1:
				aux += 1
				if aux == 3:
					return 'WIN'
			elif j == 3 and cont3 == 1:
				aux += 1
				if aux == 3:
					return 'WIN'
			elif j == 4 and cont4 == 1:
				aux += 1
				if aux == 3:
					return 'WIN'
			elif j == 5 and cont5 == 1:
				aux += 1
				if aux == 3:
					return 'WIN'
			elif j == 6 and cont6 == 1:
				aux += 1
				if aux == 3:
					return 'WIN'
			elif j == 7 and cont7 == 1:
				aux += 1
				if aux == 3:
					return 'WIN'
			elif j == 8 and cont8 == 1:
				aux += 1
				if aux == 3:
					return 'WIN'
			elif j == 9 and cont == 1:
				aux += 1
				if aux == 3:
					return 'WIN'
			elif j == 10 and cont10 == 1:
				aux += 1
				if aux == 3:
					return 'WIN'
			else:
				continue
		return 'FAIL'
	else:
		return 'WIN'
arr = []
n = int(input())
for i in range(n):
	arr.append(list(map(int, input().strip().split())))
print(friend(arr, n))


from sys import stdin

def get_ints():
	return list(map(int, stdin.readline().strip().split()))
n = int(input())
ar = [False] * 5
for i in range(n):
	(a, b) = get_ints()
	ar[a - 1] += 1
	ar[b - 1] += 1
b = [1, 3, 0, 4]
if any((x in b for x in ar)):
	print('WIN')
else:
	print('FAIL')


m = int(input())
f = {1: 0, 2: 0, 3: 0, 4: 0, 5: 0}
for i in range(m):
	(a, b) = [int(x) for x in input().split(' ')]
	f[a] += 1
	f[b] += 1
if 3 in f.values() or 1 in f.values() or 0 in f.values() or (4 in f.values()) or (5 in f.values()):
	print('WIN')
else:
	print('FAIL')


m = int(input())
n = {}
n[1] = 0
n[2] = 0
n[3] = 0
n[4] = 0
n[5] = 0
for i in range(m):
	(a, b) = map(int, input().split())
	n[a] += 1
	n[b] += 1
if n[1] == n[2] == n[3] == n[4] == n[5] and n[1] == 2:
	print('FAIL')
else:
	print('WIN')


n = int(input())
friends = {}
for i in range(n):
	(a, b) = map(int, input().split())
	if a in friends:
		friends[a].append(b)
	else:
		friends[a] = [b]
	if b in friends:
		friends[b].append(a)
	else:
		friends[b] = [a]
co = False
for each in friends:
	if len(friends[each]) != 2:
		co = True
if co or len(friends) < 5:
	print('WIN')
else:
	print('FAIL')


m = int(input())
l = [0] * 5
for i in range(m):
	(a, b) = map(int, input().split())
	l[a - 1] += 1
	l[b - 1] += 1
if l.count(2) == 5:
	print('FAIL')
else:
	print('WIN')


g = {i + 1: set() for i in range(5)}
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	g[a].add(b)
	g[b].add(a)
for a in g:
	for b in g:
		for c in g:
			test = [a in g[b], a in g[c], b in g[a], b in g[c], c in g[a], c in g[b]]
			if a != b != c != a and (all(test) or not any(test)):
				exit(print('WIN'))
print('FAIL')


from collections import defaultdict
m = int(input())
graph = defaultdict(list)
for i in range(m):
	(a, b) = [int(x) for x in input().split()]
	graph[a].append(b)
	graph[b].append(a)
li = [[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]]
f = 0
for l in li:
	if l[0] in graph[l[1]] and l[0] in graph[l[2]] and (l[1] in graph[l[2]]):
		f = 1
		break
	if l[0] not in graph[l[1]] and l[0] not in graph[l[2]] and (l[1] not in graph[l[2]]):
		f = 1
		break
if f == 1:
	print('WIN')
else:
	print('FAIL')


import sys
n = int(sys.stdin.readline())
matrix = []
for _ in range(5):
	matrix.append([0] * 5)
for _ in range(n):
	(a, b) = map(int, sys.stdin.readline().split())
	matrix[a - 1][b - 1] = matrix[b - 1][a - 1] = 1
yes = False
for i in range(3):
	for j in range(i + 1, 4):
		for k in range(j + 1, 5):
			if matrix[i][j] == matrix[j][k] == matrix[k][i]:
				yes = True
				breakpoint
		if yes:
			break
	if yes:
		break
if yes:
	print('WIN')
else:
	print('FAIL')


import sys
n = int(input())
list1 = [[0 for i in range(6)] for i in range(6)]
for i in range(n):
	(a, b) = map(int, input().split())
	list1[a][b] = 1
	list1[b][a] = 1
for i in range(1, 6):
	for j in range(1, 6):
		for k in range(1, 6):
			if i != j and j != k and (i != k):
				if list1[i][j] == 1 and list1[j][k] == 1 and (list1[k][i] == 1):
					f = 1
					print('WIN')
					sys.exit()
				elif list1[i][j] == 0 and list1[j][k] == 0 and (list1[k][i] == 0):
					print('WIN')
					sys.exit()
print('FAIL')


n = int(input())
l = [0, 0, 0, 0, 0]
for i in range(n):
	(a, b) = map(int, input().split())
	for j in range(6):
		if a == j:
			l[j - 1] += 1
		if b == j:
			l[j - 1] += 1
if l.count(2) != 5:
	print('WIN')
else:
	print('FAIL')


from sys import stdin, stdout
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
n = ii1()
c = [0] * 5
for _ in range(n):
	(a, b) = iia()
	c[a - 1] += 1
	c[b - 1] += 1
if c.count(2) != 5:
	print('WIN')
else:
	print('FAIL')


m = int(input())
n = {}
n[5] = 0
n[4] = 0
n[3] = 0
n[2] = 0
n[1] = 0
for i in range(m):
	g = input().split()
	n[int(g[0])] += 1
	n[int(g[1])] += 1
if n[1] == n[2] == n[3] == n[4] == n[5] == 2:
	print('FAIL')
	exit()
print('WIN')


num = int(input())
val = [[], [], [], [], []]
for i in range(num):
	(a, b) = list(map(int, input().split(' ')))
	val[a - 1].append(b - 1)
	val[b - 1].append(a - 1)
one = False
three = False
for i in val:
	if len(i) >= 3:
		three = True
	if len(i) <= 1:
		one = True
if one or three:
	print('WIN')
else:
	print('FAIL')


m = int(input())
ls = [[0 for i in range(6)] for j in range(6)]
for i in range(m):
	(u, v) = map(int, input().split())
	ls[u][v] = 1
	ls[v][u] = 1
flag = False
for i in range(1, 6):
	for j in range(i + 1, 6):
		for k in range(j + 1, 6):
			if ls[i][j] == 1 and ls[j][k] == 1 and (ls[k][i] == 1):
				flag = True
			if ls[i][j] == 0 and ls[j][k] == 0 and (ls[k][i] == 0):
				flag = True
if flag:
	print('WIN')
else:
	print('FAIL')


g = [[False for i in range(6)] for j in range(6)]
for _ in range(int(input())):
	(u, v) = map(int, input().split())
	g[u][v] = True
	g[v][u] = True
for i in range(1, 6):
	for j in range(1, 6):
		for k in range(1, 6):
			if i != j and j != k and (i != k):
				if g[i][j] == True and g[i][k] == True and (g[j][k] == True):
					print('WIN')
					exit()
				if not g[i][j] == True and (not g[i][k] == True) and (not g[j][k] == True):
					print('WIN')
					exit()
print('FAIL')


import sys
import math
n = int(input())
if n == 0:
	print('WIN')
	exit()
k = [0] * 5
for i in range(n):
	(a, b) = [int(x) for x in sys.stdin.readline().split()]
	k[a - 1] += 1
	k[b - 1] += 1
for i in range(5):
	if k[i] != 2:
		print('WIN')
		exit()
print('FAIL')


try:
	t = int(input())
	m = [0] * 10
	for i in range(0, t):
		(a, b) = list(map(int, input().split(' ')))
		m[a] += 1
		m[b] += 1
	g = 0
	for i in range(1, 6):
		if m[i] == 1 or m[i] == 3 or m[i] == 0 or (m[i] == 4):
			g = 1
			break
	if g == 0:
		print('FAIL')
	else:
		print('WIN')
except:
	pass


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest, _heapify_max, _heapreplace_max
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from fractions import Fraction
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def outln(var):
	sys.stdout.write(str(var) + '\n')

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
n = int(data())
graph = dd(set)
for i in range(n):
	(u, v) = sp()
	graph[u].add(v)
	graph[v].add(u)
for i in range(1, 6):
	if len(graph[i]) != 2:
		outln('WIN')
		exit()
outln('FAIL')


gh = [[0] * 6 for _ in ' ' * 6]
a = int(input())
for _ in ' ' * a:
	(u, v) = map(int, input().split())
	gh[u][v] = 1
	gh[v][u] = 1
(ok1, ok2) = (0, 0)
for i in range(1, 6):
	for j in range(1, 6):
		for k in range(1, 6):
			if i == j or j == k or i == k:
				continue
			if gh[i][j] and gh[j][k] and gh[k][i]:
				ok1 = 1
			if gh[i][j] == 0 and gh[j][k] == 0 and (gh[k][i] == 0):
				ok2 = 1
if not ok1 and (not ok2):
	print('FAIL')
else:
	print('WIN')


from collections import defaultdict
from itertools import combinations
n = int(input())
graph = defaultdict(set)
rev_graph = defaultdict(set)
for _ in range(n):
	(x, y) = map(int, input().split())
	graph[x].add(y)
	graph[y].add(x)
for (k, v) in graph.items():
	rev_graph[k] = set((i for i in range(1, 5 + 1) if i != k and i not in v))

def check(a, b, c, g):
	for e in g[a]:
		if e == b or e == c:
			return False
	for e in g[b]:
		if e == a or e == c:
			return False
	for e in g[c]:
		if e == a or e == b:
			return False
	return True
for (a, b, c) in combinations(range(1, 6), 3):
	if check(a, b, c, graph) or check(a, b, c, rev_graph):
		print('WIN')
		exit()
print('FAIL')


def inp():
	return map(int, stdin.readline().split())

def ocycle(x):
	if x[0] in g.gdict[x[1]] and x[2] in g.gdict[x[1]] and (x[0] in g.gdict[x[2]]):
		return True
	return False

def ouncycle(x):
	if x[0] not in g.gdict[x[1]] and x[2] not in g.gdict[x[1]] and (x[0] not in g.gdict[x[2]]):
		return True
	return False

class graph:

	def __init__(self, gdict=None):
		if gdict is None:
			gdict = defaultdict(list)
		self.gdict = gdict

	def edges(self):
		return self.find_edges()

	def find_edges(self):
		edges = []
		for node in self.gdict:
			for nxNode in self.gdict[node]:
				if {nxNode, node} not in edges:
					edges.append({node, nxNode})
		return edges

	def get_vertices(self):
		return list(self.gdict.keys())

	def add_vertix(self, node):
		if node not in self.gdict:
			self.gdict[node] = []

	def add_edge(self, node1, node2):
		self.gdict[node1].append(node2)
		self.gdict[node2].append(node1)
from sys import *
from collections import *
from itertools import *
(g, com) = (graph(), list(combinations([i for i in range(1, 6)], 3)))
for i in range(int(input())):
	(u, v) = inp()
	g.add_edge(u, v)
for i in com:
	if ocycle(i) or ouncycle(i):
		exit(print('WIN'))
print('FAIL')


m = int(input())
adj = [[0 for _ in range(5)] for _ in range(5)]
ok = 0
for _ in range(m):
	(a, b) = map(int, input().split())
	adj[a - 1][b - 1] = 1
	adj[b - 1][a - 1] = 1
for i in range(5):
	for j in range(i + 1, 5):
		for k in range(j + 1, 5):
			tmp = adj[i][j] + adj[j][k] + adj[i][k]
			if tmp == 3 or not tmp:
				ok = 1
if ok:
	print('WIN')
else:
	print('FAIL')


from collections import defaultdict
from sys import exit

class Graph:

	def __init__(self):
		self.adj = defaultdict(list)

	def add_edge(self, x, y):
		self.adj[x].append(y)
		self.adj[y].append(x)

	def check(self):
		for i in range(1, 6):
			for j in range(i + 1, 6):
				for k in range(j + 1, 6):
					if j not in self.adj[i] and k not in self.adj[j] and (i not in self.adj[k]):
						print('WIN')
						exit(0)
					if j in self.adj[i] and k in self.adj[j] and (i in self.adj[k]):
						print('WIN')
						exit(0)
		print('FAIL')
g = Graph()
n = int(input())
for _ in range(n):
	(x, y) = map(int, input().split())
	g.add_edge(x, y)
g.check()


m = int(input())
g = [tuple(map(int, input().split())) for i in range(m)]
g1 = [(y, x) for (x, y) in g] + g
ans = 'FAIL'
for a in range(1, 6):
	for b in range(a + 1, 6):
		for c in range(b + 1, 6):
			if (a, b) in g1 and (b, c) in g1 and ((a, c) in g1):
				ans = 'WIN'
			if not (a, b) in g1 and (not (b, c) in g1) and (not (a, c) in g1):
				ans = 'WIN'
print(ans)


from collections import Counter
c = Counter()
for _ in range(int(input())):
	c.update(input().split())
print('FAIL' if all((c[x] == 2 for x in '12345')) else 'WIN')


m = int(input())
pairs = []
for i in range(m):
	(a, b) = map(int, input().split())
	a = a - 1
	b = b - 1
	pairs.append((a, b))
for i in range(5):
	for j in range(i + 1, 5):
		for k in range(j + 1, 5):
			ans = 0
			for t in range(m):
				if pairs[t] == (i, j) or pairs[t] == (j, i):
					ans += 1
				elif pairs[t] == (j, k) or pairs[t] == (k, j):
					ans += 1
				elif pairs[t] == (i, k) or pairs[t] == (k, i):
					ans += 1
			if ans == 3 or ans == 0:
				print('WIN')
				exit(0)
print('FAIL')


from collections import defaultdict
from itertools import combinations

class Graph:

	def __init__(self):
		self.graph = defaultdict(list)
		self.matrix = [[0 for i in range(5)] for j in range(5)]

	def addEdge(self, fr, to):
		self.graph[fr].append(to)
		self.graph[to].append(fr)
		self.matrix[fr - 1][to - 1] = 1
		self.matrix[to - 1][fr - 1] = 1

	def solveUtil(self, a, b, c):
		if self.matrix[a - 1][b - 1] == 1 and self.matrix[a - 1][c - 1] == 1 and (self.matrix[b - 1][a - 1] == 1) and (self.matrix[b - 1][c - 1] == 1) and (self.matrix[c - 1][a - 1] == 1) and (self.matrix[c - 1][b - 1] == 1):
			return True
		elif self.matrix[a - 1][b - 1] == 0 and self.matrix[a - 1][c - 1] == 0 and (self.matrix[b - 1][a - 1] == 0) and (self.matrix[b - 1][c - 1] == 0) and (self.matrix[c - 1][a - 1] == 0) and (self.matrix[c - 1][b - 1] == 0):
			return True
		else:
			return False

	def solve(self, comb):
		for i in comb:
			if self.solveUtil(i[0], i[1], i[2]) == True:
				return True
		return False
m = int(input())
G = Graph()
for _ in range(m):
	(fr, to) = map(int, input().split())
	G.addEdge(fr, to)
X = list(range(1, 6))
comb = list(combinations(X, 3))
if G.solve(comb):
	print('WIN')
else:
	print('FAIL')


m = int(input())
L = [[False for i in range(5)] for j in range(5)]
for i in range(m):
	relation = [int(s) for s in input().split()]
	L[relation[0] - 1][relation[1] - 1] = True
	L[relation[1] - 1][relation[0] - 1] = True
bool = False
for i in range(3):
	for j in range(i + 1, 4):
		for k in range(j + 1, 5):
			bool = bool or (L[i][j] == L[j][k] and L[j][k] == L[i][k])
if bool == False:
	print('FAIL')
else:
	print('WIN')


from collections import defaultdict as df
d = df(list)
n = int(input())
visited = [0] * 6
for i in range(n):
	(a, b) = list(map(int, input().split()))
	d[a].append(b)
	d[b].append(a)
	visited[a] = True
	visited[b] = True
count = 0
for i in d:
	if len(d[i]) == 1:
		count += 1
flag = 0
for i in d:
	if len(d[i]) >= 3:
		flag = 1
		break
	if len(d[i]) == 1:
		flag = 1
		break
for i in range(1, 6):
	if visited[i] == False:
		flag = 1
		break
if flag:
	print('WIN')
else:
	print('FAIL')


from sys import stdin, stdout
import math
from collections import Counter, deque
L = lambda : list(map(int, stdin.readline().strip().split()))
M = lambda : map(int, stdin.readline().strip().split())
I = lambda : int(stdin.readline().strip())
IN = lambda : stdin.readline().strip()
C = lambda : stdin.readline().strip().split()
mod = 1000000007

def s(a):
	print(' '.join(list(map(str, a))))

def solve():
	a = [0] * 6
	n = I()
	for i in range(n):
		(x, y) = M()
		a[x] += 1
		a[y] += 1
	if a.count(2) == 5:
		print('FAIL')
	else:
		print('WIN')
t = 1
for i in range(t):
	solve()