program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  fi,fo:Text;
  a,b,i,j,k,q,m: Integer;
  graph,antigraph: array [1..6,1..6] of Integer;

begin

   read(m);
   for i:=1 to 5 do
    for j:=1 to 5  do
      antigraph[i][j]:=1;

   for i:=1 to m do
    begin
      read(a,b);
      graph[a][b]:=1;
      graph[b][a]:=1;
      antigraph[a][b]:=0;
      antigraph[b][a]:=0;
    end;
   for i:=1 to 5 do
    begin
      for j:=i+1 to 5 do
        begin
          if(graph[i][j]=1) then
            begin
              for k:=j+1 to 5 do
                begin
                  if((graph[j][k]=1) and (graph[i][k]=1)) then
                    begin
                      write('WIN');

                      Exit;
                    end;
                end;
            end;
        end;

    end;
     for i:=1 to 5 do
    begin
      for j:=i+1 to 5 do
        begin
          if(antigraph[i][j]=1) then
            begin
              for k:=j+1 to 5 do
                begin
                  if((antigraph[j][k]=1) and (antigraph[i][k]=1)) then
                    begin
                      write('WIN');

                      Exit;
                    end;
                end;
            end;
        end;

    end;

   write('FAIL');

end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  g : array [1..5, 1..5] of boolean;
  a, b, i, j, k, m : integer;

begin
  REadln (m);
  for i := 1 to m do begin
    Readln (a, b);
    g [a, b] := True;
    g [b, a] := True;
  end;

  for i := 1 to 5 do
    for j := 1 to 5 do
      for k := 1 to 5 do
        if (g [i, j] and g [i, k] and g [j, k]) or ((not g [k, j]) and (not g [i, j]) and (not g [i, k])) and (i <> j) and (j <> k) and (i <> k) then begin
          Writeln ('WIN');
    //      Writeln (i, ' ', j, ' ', k);
          Readln;
          Halt;
        end;
  Writeln ('FAIL');
  Readln;
end.

program ProjectA;

{$APPTYPE CONSOLE}
{$A+,B-,D+,E+,F+,G-,I+,L+,N+,O-,R+,Q+,S+,V+,X+}
// {$A+,B-,D-,E+,F+,G-,I-,L-,N+,R-,Q-,S-,V+,X+}

uses
  SysUtils,
  Math;

const
  inf = 1000000000000000000;
//  base = 1000000009;
//  eps = 1e-9;
//  pi = 3.141592653589793238;

var
  n, m, i, j, res, k, res1, res2, l, r, x, y, z, len: integer;
  a, b: array [0..10001] of integer;
  w, s1, s2, snew: string;
  yes: array [0..101] of boolean;
  ok: array [0..101, 0..101] of boolean;
  s, st: array [0..101] of string;
  ch: char;
  g: array [0..100, 0..100] of boolean;

procedure panic(dxp: integer);
begin
  write(dxp);
  halt(0);
end;

procedure panic64(dxi64: int64);
begin
  write(dxi64);
  halt(0);
end;

procedure panics(kws: string);
begin
  write(kws);
  halt(0);
end;

procedure swap(var qx, qy: integer);
var
  qz: integer;
begin
  qz := qx;
  qx := qy;
  qy := qz;
end;

procedure swap64(var qx1, qy1: int64);
var
  qz1: int64;
begin
  qz1 := qx1;
  qx1 := qy1;
  qy1 := qz1;
end;

procedure swapex(var qx2, qy2: extended);
var
  qz2: extended;
begin
  qz2 := qx2;
  qx2 := qy2;
  qy2 := qz2;
end;

procedure swaps(var qs1, qs2: string);
var
  qs3: string;
begin
  qs3 := qs1;
  qs1 := qs2;
  qs2 := qs3;
end;

begin
  {$IFNDEF ONLINE_JUDGE}
  Reset(input, 'input.txt');
  Rewrite(output, 'output.txt');
  {$ENDIF}

  read(m);
  if m <= 2 then
    panics('WIN');
  for i := 1 to m do
    begin
      read(a[i], b[i]);
      g[a[i], b[i]] := true;
      g[b[i], a[i]] := true;
    end;
  n := 5;
  for i := 1 to m do
    for j := 1 to n do
      if g[a[i], j] and g[b[i], j] then
        panics('WIN');

  for i := 1 to n do
    for j := 1 to n do
      for l := 1 to n do
        if (i <> j) and (j <> l) and (i <> l) then
          if (not g[i, j]) and (not g[j, l]) and (not g[l, i]) then
            panics('WIN');

  write('FAIL')

end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
   x,y,m,temp,i,j,k:integer;
   ok:boolean;
   a:array [1..5,1..5] of integer;
begin
   //reset(input,'input.txt');
   Readln(m);
   fillchar(a,sizeof(a),0);
   for i:=1 to m do
    begin
      ReadLn(x,y);
      a[x,y]:=1;
      a[y,x]:=1;
    end;

   //rewrite(output,'output.txt');
   ok:=false;
   for i:=1 to 3 do
    for j:=i+1 to 4 do
     for k:=j+1 to 5 do
       if ((a[i,j]=1) and (a[i,k]=1) and (a[j,k]=1)) or
          ((a[i,j]=0) and (a[i,k]=0) and (a[j,k]=0)) then ok:=true;
   if ok then WriteLn('WIN')
         else WriteLn('FAIL');
end.

var n,m,x,y:integer;
    c:array[1..5,1..5]of integer;
    i,j,k:integer;

begin
n:=5;
  readln(m);
  for i:=1 to m do begin
  readln(x,y);
  c[x,y]:=1;
  c[y,x]:=1;
  end;
  for i:=1 to n do
   for j:=i+1 to n do
    for k:=j+1 to n do
      begin
      m:=c[i,j]+c[i,k]+c[j,k];
      if ((m=0)or(m=3)) then begin writeln('WIN'); exit; end;
  end;
writeln('FAIL');
    readln;
   readln;
end.

var a,b,n,i,j:integer;
    c:array[1..5,1..5]of integer;
    q,w,e,r,t:integer;
begin
readln(n);
for i:=1 to 5 do
 for j:=1 to 5 do c[i,j]:=0;

for i:=1 to n do begin
readln(a,b);
c[a,b]:=1;
c[b,a]:=1;
end;
for i:=1 to 5 do c[i,i]:=5;
a:=0;
b:=0;
for q:=1 to 5 do
 for w:=q+1 to 5 do
  for e:=w+1 to 5 do
  begin
  if (c[q,w]=1)and(c[w,e]=1)and(c[q,e]=1) then begin  a:=1;  end;
  if (c[q,w]=0)and(c[w,e]=0)and(c[q,e]=0) then begin  b:=1;  end;
  end;

if ((a=1)or(b=1)) then writeln('WIN') else writeln('FAIL');

readln;
  { TODO -oUser -cConsole Main : Insert code here }
end.

program B;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  I, J, K, N, X, Y: Longint;
  Bo: Boolean;
  A: array [1..5, 1..5] of Boolean;

begin
//  Assign(Input, 'Input.txt');
//  Assign(Output, 'Output.txt');

  Bo := False;
  FillChar(A, SizeOf(A), False);
  Readln(N);
  for I := 1 to N do
    begin
      Readln(X, Y);
      A[X, Y] := True;
      A[Y, X] := True;
    end;
  for I := 1 to 3 do
    for J := I+1 to 4 do
      for K := J+1 to 5 do
        Bo := Bo or ((A[I, J] and A[J, K] and A[I, K]) or not (A[I, J] or A[J, K] or A[I, K]));

  if Bo
    then Writeln('WIN')
    else Writeln('FAIL');
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

const t:array[1..10,1..3] of integer=((1,2,3),(1,2,4),(1,2,5),(2,3,4),(2,3,5),(2,4,5),(3,4,5),(1,3,4),(1,3,5),(1,5,4));

var z,c,x,y,i,j,n,k,ans:integer;
a:Array [1..10,1..10] of boolean;
str,tmp:string;
w,e:boolean;
begin
readln(N);

for I := 1 to 6 do
for j := 1 to 6 do
a[i,j]:=false;

for I := 1 to n do
begin
read(x,y);
a[x,y]:=true;
a[y,x]:=true;
end;

w:=false;
e:=false;

for I := 1 to 10 do
begin
z:=t[i][1];
x:=t[i][2];
c:=t[i][3];

if (a[x,z] and a[x,c] and a[z,c]) then begin w:=true; writeln('WIN'); halt;end;

if ((not a[x,z]) and (not a[x,c]) and (not a[c,z])) then begin e:=true; writeln('WIN'); halt;end;

end;

//if (not e) and (not w) then writeln('WIN') else
writeln('FAIL');

//while True do

end.

{$apptype console}
{$R+,S+,I+,Q+}
const
     inf = 'input.txt';
     outf = 'output.txt';
var
 m,i,a,b:longint;
 zn:array[0..10,0..10] of boolean;

 function check1(x:longint):boolean;
 var i,j:longint;
  begin
   check1:=true;
   for i:=1 to 5 do if zn[i,x] then
    for j:=1 to 5 do if (zn[i,j]) and (zn[x,j]) then exit;
   check1:=false;
  end;

 function check2(x:longint):boolean;
 var i,j:longint;
  begin
   check2:=true;
   for i:=1 to 5 do if (i <> x) and (not zn[i,x]) then
    for j:=1 to 5 do if (x <> j) and (i <> j) then
     if (not zn[i,j]) and (not zn[x,j]) then exit;
   check2:=false;
  end;

begin
 //reset(input,inf);
 //rewrite(output,outf);
 read(m);
 fillchar(zn,sizeof(zn),false);
 for i:=1 to m do
  begin
   read(a,b);
   if a = b then continue;
   zn[a,b]:=true;
   zn[b,a]:=true;
  end;
 for i:=1 to 5 do if check1(i) or check2(i) then
  begin
   writeln('WIN');
   halt;
  end;
 writeln('FAIL');
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

label
  1;
var
  a:array[1..5,1..5] of integer;
  f,x,y,i,j,k,n,m:integer;
begin
  readln(m);
  for I:=1 to m do begin
    readln(x,y);
    a[x,y]:=1;a[y,x]:=1;
  end;
  f:=0;
  for i:=1 to 5 do begin
    for j:=i+1 to 5 do begin
      for k:=j+1 to 5 do begin
        n:=a[i,j]+a[i,k]+a[j,k];
        if (n=0) or (n=3) then begin
          f:=1;
          goto 1;
        end;
      end;
    end;
  end;
1:
  if f=1 then writeln('WIN') else writeln('FAIL');
  readln;
  { TODO -oUser -cConsole Main : Insert code here }
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  a: array [1..5, 1..5] of Byte;
  i, j, k, b, e, m: Integer;

function known(q, w, e: Integer): Boolean;
begin
  Result := (a[q, w] = 1) and (a[w, e] = 1) and (a[q, e] = 1);
end;

function unknown(q, w, e: Integer): Boolean;
begin
  Result := (a[q, w] <> 1) and (a[w, e] <> 1) and (a[q, e] <> 1);
end;

begin
{
  reset(input, 'friends.in');
  rewrite(output, 'friends.out');
}
  Readln(m);
  for i := 1 to m do
  begin
    Readln(b, e);
    a[b, e] := 1;
    a[e, b] := 1;
  end;

  for i := 1 to 3 do
  begin
    for j := i + 1 to 4 do
    begin
      for k := j + 1 to 5 do
      begin
        if known(i, j, k) or unknown(i, j, k) then
        begin
          Writeln('WIN');
          Halt(0);
        end;
      end;
    end;
  end;

  Writeln('FAIL');

end.

program ProjectB;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  n, i, j, k, x, y: Integer;
  a: array[1..5, 1..5] of Integer;
begin
  //reset(input, 'input.txt');
  //write(output, 'output.txt');
  Readln(n);
  for i := 1 to n do
  begin
    Readln(x, y);
    a[x, y] := 1;
    a[y, x] := 1;
  end;
  {if n < 5 then
  begin
    Writeln('WIN');
    Halt;
  end;}
  for i := 1 to 5 do
    for j := i + 1 to 5 do
      for k := j + 1 to 5 do
      begin
        if ((a[i, j] = 1)and(a[i, k] = 1)and(a[k, j] = 1))or((a[i, j] = 0)and(a[i, k] = 0)and(a[j, k] = 0)) then
        begin
          Writeln('WIN');
          Halt;
        end;
      end;
  Writeln('FAIL');
  readln;
  //close(input);
  //close(output);
end.

{$R+,Q+,I+}
{$apptype console}
Uses SysUtils;
Var
   x:Array[1..5, 1..5] of Boolean;
   i,j,p,n,a,b:Integer;
Begin
   Read(n);
   For i:=1 To 5 Do
      For j:=1 To 5 Do Begin
         If i=j Then continue;
         x[i,j]:=FALSE;
      End;
   For i:=1 To n Do Begin
      Read(a,b);
      x[a,b]:=TRUE;
      x[b,a]:=TRUE;
   End;
   For i:=1 To 5 Do
      For j:=1 To 5 Do Begin
        If i=j Then continue;
        For p:=1 To 5 Do Begin
           If (p=i) or (p=j) Then continue;
           If (x[i,j]=x[j,p]) and (x[j,p]=x[p,i]) Then Begin
              Write('WIN');
              Halt;
           End;
        End;
      End;
   Write('FAIL');
End.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var a : array [1..5,1..5] of boolean;
var m,i,j,t1,t2,t3 : integer;

begin
  read(m);
  fillchar(a, sizeof(a), 0);
  for i := 1 to m do
    begin
      read(t1,t2);
      a[t1,t2] := true;
      a[t2,t1] := true;
    end;
  for t1 := 1 to 5 do
    for t2 := t1+1 to 5 do
      for t3 := t2+1 to 5 do
        if (a[t1,t2] and a[t2,t3] and a[t1,t3]) or ((not a[t1,t2]) and (not a[t2,t3]) and (not a[t1,t3])) then
          begin writeln('WIN'); halt; end;
  writeln('FAIL');

end.

program Solve_B;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var a: array[1..5, 1..5] of longint;
i, j, m, n, k: longint;
f: boolean;
begin
  //reset(input, 'a.in');
  //rewrite(output, 'a.out');

  readln(m);
  for i := 1 to m do
    begin
      read(n, k);
      a[n, k] := 1;
      a[k, n] := 1;
    end;

  f := false;
  for i := 1 to 3 do
   for j := 2 to 4 do
     for k := 3 to 5 do
       begin
         if ((i <> j) and (i <> k) and (j <> k)) and ((a[i, j]*a[j, k]*a[k, i] = 1) or (a[i, j] + a[j, k] + a[i, k] = 0))
          then f := true;
       end;

  if f then write('WIN') else write('FAIL');
end.

var arr:array[1..5,1..5] of byte;
i,n,j,k,x,y:byte;
flag:boolean;
begin
readln(n);
for i:=1 to n do
 begin
  readln(x,y);
  arr[x,y]:=1;
  arr[y,x]:=1;
 end;

flag:=false;
for i:=1 to 5 do
 for j:=1 to 5 do
  for k:=1 to 5 do
   begin
    if (i<>j) and (j<>k) and (i<>k) and (arr[i,j]=arr[j,k]) and (arr[j,k]=arr[k,i])
     then
      begin
       flag:=true;
      end;
   end;
if flag=true then writeln('WIN')
             else writeln('FAIL');
end.

var a:array[1..5]of byte;
        n,x,y,i:byte;
begin
        read(n);
    for i:=1 to n do
    begin
        read(x,y);
        inc(a[x]);
        inc(a[y]);
    end;
    for i:=1 to 5 do
    begin
        if a[i]>2 then begin write('WIN');halt;end;
        if 4-a[i]>2 then begin write('WIN');halt;end;
    end;
    write('FAIL');
end.

const
    finp='';
    fout='';
var dau:array [1..10] of string;
    x,y,z,n,i,LC1,LC2,LC3:longint;
    KQ,s1,s2,s3:string;
    f,g:text;
begin
    assign(f,finp); reset(f);
    assign(g,fout); rewrite(g);
    readln(f,n);
    for i:=1 to n do
        begin
            readln(f,x,y);
            str(x,s1); str(y,s2);
            insert(s2,dau[x],length(dau[x])+1);
            insert(s1,dau[y],length(dau[y])+1);
        end;
    for x:=1 to 5 do
        for y:=1 to 5 do
            for z:=1 to 5 do
                begin
                    str(x,s1); str(y,s2); str(z,s3); LC1:=0; LC2:=0; LC3:=0;
                    if not ((x=y) or (y=z) or (z=x)) then
                        begin
                            if (pos(s1,dau[y])<>0) and (pos(s1,dau[z])<>0) then LC1:=1
                            else
                                if (pos(s1,dau[y])<>0) or (pos(s1,dau[z])<>0) then LC1:=2;
                            if (pos(s2,dau[x])<>0) and (pos(s2,dau[z])<>0) then LC2:=1
                            else
                                if (pos(s2,dau[x])<>0) or (pos(s2,dau[z])<>0) then LC2:=2;
                            if (pos(s3,dau[y])<>0) and (pos(s3,dau[x])<>0) then LC3:=1
                            else
                                if (pos(s3,dau[y])<>0) or (pos(s3,dau[x])<>0) then LC3:=2;
                            if (LC1=LC2) and (LC2=LC3) and (LC3=LC1) then
                                if (LC1=1) or (LC1=0) then KQ:='WIN';
                        end;
                end;
    if KQ<>'WIN' then KQ:='FAIL';
    write(g,KQ); close(g); close(f);
end.

Type tm=Array [1..10] of LongInt;
Var m:tm;
n,x,y,i:LongInt;
f:Boolean;
Begin
     Readln (n);
     For I:=1 to n do
     Begin
          Readln (x,y);
          Inc (m[x]);
          Inc (m[y])
     End;
     f:=True;
     For I:=1 to 5 do
     If m[i]<>2 then f:=False;
     If f and (n=5)
     then Writeln ('FAIL')
     else Writeln ('WIN')
End.

var
o1,o2:boolean;
i,x,y,m:longint;
e,a:array[0..100]of longint;

procedure run(v,t,mask:longint);
 begin
  if v=5 then
    begin
     if t=3 then
       begin
        o1:=false;
        o2:=false;
        for i:=1 to t do
          if (a[e[i]] and mask)=(mask xor (1 shl e[i]))then o1:=true
                else if (a[e[i]] and mask)=0 then o2:=true else exit;

        writeln('WIN');
        halt(0);
       end;
     exit;
    end;
  run(v+1,t,mask);
  e[t+1]:=v;
  run(v+1,t+1,mask or (1 shl v));
 end;

 begin
  read(m);
  for i:=1 to m do
    begin
     read(x,y);
     x:=x-1;
     y:=y-1;
     a[x]:=a[x] or (1 shl y);
     a[y]:=a[y] or (1 shl x);
    end;

  run(0,0,0);
  writeln('FAIL');
 end.

var a : array[1..5] of byte;
i, j, m, x, y : byte;
b : boolean;
begin
fillchar(a, sizeof(a), 0);
read(m);
for i := 1 to m do begin
  read(x, y);
  inc(a[x]);
  inc(a[y]);
end;
b := false;
for i := 1 to 5 do
  if a[i] <> 2 then b := true;
if b then writeln('WIN')
  else writeln('FAIL');
end.

var
  m,i,a,b:longint;
  map:array[1..5,1..5] of longint;

procedure check(a,b,c:longint);
  var
    x:longint;
  begin
    x:=map[a,b]+map[b,c]+map[a,c];
    if (x=3)or(x=0) then
      begin
        writeln('WIN');halt;
      end;
  end;

begin
  readln(m);
  for i:=1 to m do
    begin
      readln(a,b);
      map[a,b]:=1;map[b,a]:=1;
    end;

  check(1,2,3);
  check(1,2,4);
  check(1,2,5);
  check(1,3,4);
  check(1,3,5);
  check(1,4,5);

  check(2,3,4);
  check(2,3,5);
  check(2,4,5);

  check(3,4,5);

  writeln('FAIL');
end.

Var x,y,i,n,j,u,u1:LongInt;
    a:Array[1..1000,1..1000] of LongInt;
    a1,a2:Array[1..1000] of LongInt;
    y1:String;
  begin
    ReadLn(n);
    fillchar(a,sizeof(a),0);
    For i:=1 to n do
     begin
       Read(x,y);
       a[x,y]:=1;
       A[y,x]:=1;
     end;
    y1:='FAIL';
    For i:=1 to 5 do
     begin
       u:=0;
       u1:=0;
     For j:=1 to 5 do
      if (i<>j) and (a[i,j]=1) then begin u:=u+1; end
      else if (i<>j) and (a[i,j]=0) then begin u1:=u1+1; end;
      if u>=3 then begin y1:='WIN'; Break; end;
      if (u1>=3) then begin y1:='WIN'; Break; end;
     end;
    WriteLn(y1);
  end.

{$Apptype console}
var
  n,x,y,i,j,k : longint;
  g : array [1..5,1..5] of longint;
begin
  readln(n);
  for i:=1 to n do
    begin
      readln(x,y);
      g[x,y]:=1;
      g[y,x]:=1;
    end;
  for i:=1 to 5 do
    for j:=1 to 5 do
      begin
        if i=j then continue;
        for k:=1 to 5 do
          begin
            if (i=k) or (j=k) then continue;
            if ((g[i,j]=1) and (g[i,k]=1) and (g[j,k]=1)) or
               ((g[i,j]=0) and (g[i,k]=0) and (g[j,k]=0))
              then begin
                writeln('WIN');
                exit;
              end;
          end;
      end;
  writeln('FAIL');
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  i, j, k, x, y: Integer;
  m: Integer;
  A: array [1..5, 1..5] of Boolean;
  Flag: Boolean;

begin
  for i := 1 to 5 do
    for j := 1 to 5 do
      A[i, j] := False;
  readln(m);
  for i := 1 to m do
    begin
      readln(x, y);
      a[x, y] := True; a[y, x] := True;
    end;
  Flag := False;
  for i := 1 to 5 do
    for j := i+1 to 5 do
      for k := j+1 to 5 do
        if (a[i, j] = a[i, k]) and (a[i, j] = a[j, k]) then
          begin
            Flag := True;
            break;
          end;
  if Flag then
    writeln('WIN')
  else
    writeln('FAIL');
  readln;
end.

var x,y,n,i:longint;
ans:boolean;
    a:array[1..1000]of longint;
begin
readln(n);
for i:=1 to n do
  begin
    readln(x,y);
    inc(a[x]);
    inc(a[y]);
  end;
ans:=false;
for i:=1 to 5 do
  if a[i]<>2 then begin ans:=true;break; end;
if ans=true then write('WIN')
else write('FAIL');
end.

{$APPTYPE CONSOLE}
{$R-,Q-,S+,O+}
var
  a : array [1..5, 1..5] of Boolean;
  i, j, k, m, x, y : LongInt;
begin
//  reset(input, 'input.txt');
//  rewrite(output, 'output.txt');
  Readln(m);
  FillChar(a, SizeOf(a), 0);
  for i := 1 to m do
    begin
      read(x, y);
      a[x, y] := true;
      a[y, x] := true;
    end;
  for i := 1 to 5 do
    for j := i + 1 to 5 do
      for k := j + 1 to 5 do
        if a[i, j] and a[i, k] and a[j, k] or not a[i, j] and not a[i, k] and not a[j, k] then
          begin
            Writeln('WIN');
            halt;
          end;
  Writeln('FAIL');
end.

var i, j, k, l, m, n:longint;
a:array[1..5, 1..5] of longint;
begin
    fillchar(a, sizeof(a), 0);
    readln(m);
    for i:=1 to m do begin
        read(k, l);
        a[l,k]:=1;
        a[k,l]:=1;
    end;
    for i:=1 to 3 do
     for j:=i+1 to 4 do
      for k:=j+1 to 5 do
       if ((a[i,j]=a[j,k])and(a[i,j]=a[i,k]))then begin
           writeln('WIN');
           halt(0);
       end;
       writeln('FAIL');
end.

var
a:array [1..5,1..5] of boolean;
i,j,k,n,x,y:integer;
begin
readln(n);
For i:=1 to 5 do
FOr j:=1 to 5 do
a[i,j]:=false;
For i:=1 to n do begin
read(x,y);
a[x,y]:=true;
a[y,x]:=true;
end;
For i:=1 to 3 do
For j:=i+1 to 4 do
For k:=j+1 to 5 do
if ((a[i,j]=true)and(a[j,k]=true)and(a[k,i]=true))or
((a[i,j]=false)and(a[j,k]=false)and(a[k,i]=false)) then
begin
writeln('WIN');
halt;
end;
writeln('FAIL');
end.

const
	b: array[0..10] of longint = (0, 2, 2, 2, 2, 3, 0, 0, 0, 0, 0);

var
	a: array[0..10] of longint;
	x: longint;

begin
	while not seekeof do begin
		read(x);
		inc(a[x]);
	end;
	for x := 0 to 10 do begin
		if a[x] <> b[x] then begin
			writeln('WIN');
			halt;
		end;
	end;
	writeln('FAIL');
end.

var
m:array [1..5,1..5] of integer;
n,i,a,b,j,k:longint;
begin
read(n);
for i:=1 to 5 do for j:=1 to 5 do m[i,j]:=0;
for i:=1 to n do begin read(a,b); inc(m[a,b]); inc(m[b,a]); end; a:=0; b:=0;
for i:=1 to 3 do for j:=i+1 to 4 do for k:=j+1 to 5 do
if (m[i,j]=1) and (m[i,k]=1) and (m[j,k]=1) then a:=1 else
if (m[i,j]=0) and (m[i,k]=0) and (m[j,k]=0) then b:=1;
if (a=1) or (b=1) then write('WIN') else write('FAIL');
end.

program bbbb;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var m,i,s,t,k,j:longint;
    mas:array[1..5,1..5] of longint;
    flag:boolean;
begin

 readln(m);
 for i:=1 to m do
  begin
   readln(s,t);
   mas[s,t]:=1;
   mas[t,s]:=1;
  end;

 flag:=false;

 for i:=1 to 5 do
  for j:=1 to 5 do
   for k:=1 to 5 do
    if (i<>j)and(i<>k)and(j<>k) then
     if (mas[i,j]=mas[i,k])and(mas[i,j]=mas[j,k]) then flag:=true;
 if flag then writeln('WIN')
  else writeln('FAIL');

 readln;
end.

{$APPTYPE CONSOLE}
const n=5;
var
a : array [1..n,1..n] of boolean;
i,j,m,l : byte;
ok : boolean;
begin
{reset (input,'input.txt');
rewrite (output,'output.txt');}
readln (m);
fillchar (a,sizeof (a),false);
ok:=false;
for l:=1 to m do
begin
read (i,j);
a [i,j]:=true;
a [j,i]:=true;
end;
ok:=false;
for i:=1 to n-2 do
 for j:=i+1 to n-1 do
  for l:=j+1 to n do
  if (a [i,j]=a [i,l]) and (a [i,l]=a [j,l]) then ok:=true;
 if not ok then write ('FAIL')
 else write ('WIN');
end.

Var i,j,t,n:longint;
    a:array[0..11,0..11]of longint;
Begin
       { assign(input,'input.txt');
        reset(input);
        assign(output,'output.txt');
        rewrite(output);}
        Readln(n);
        for i:=1 to n do
        begin
                Readln(j,t);
                a[j,t]:=1;
                a[t,j]:=1;
        end;
        for i:=1 to 3 do
         for j:=i+1 to 4 do
          for t:=j+1 to 5 do
                if(a[i,j]=a[i,t])and(a[i,j]=a[j,t])
                then begin
                        writeln('WIN');
                        halt;
                end;
        writeln('FAIL');
End.

program friends;
{$o-}
{$APPTYPE CONSOLE}
uses
 Math, StrUtils, SysUtils;
type
 ex=extended;
 int=longint;
 bool=boolean;
var
 a: array[1..5,1..5] of bool;
 i,j,k,m: int;
begin
fillchar(a,sizeof(a),0);
readln(m);
for i:= 1 to m do
 begin
 readln(j,k);
 a[j,k]:= true;
 a[k,j]:= true;
 end;
for i:= 1 to 5 do
 for j:= i+1 to 5 do
  for k:= j+1 to 5 do
   if (a[i,j]=a[j,k])and(a[i,j]=a[i,k])
    then
     begin
     writeln('WIN');
     //}readln;
     exit;
     end;
writeln('FAIL');
//}readln;
end.

var
  m,i,j,k,v1,v2:integer;
  a:array[1..5,1..5]of integer;
  str:string;

function prove(l,b,c:integer):boolean;
begin
  result:=false;
  if (a[l,b]=1)and(a[l,c]=1)and(a[b,c]=1)then result:=true;
  if (a[l,b]=0)and(a[l,c]=0)and(a[b,c]=0)then result:=true;
end;

begin
  for i:=1 to 5 do
    for j:=1 to 5 do
      a[i,j]:=0;
  read(m);
  for i:=1 to m do begin
    read(v1,v2);
    a[v1,v2]:=1;
    a[v2,v1]:=1;
  end;
  str:='FAIL';
  for i:=1 to 3 do
    for j:=i+1 to 4 do
      for k:=j+1 to 5 do
        if prove(i,j,k) then begin str:='WIN'; writeln(str); halt; end;
  writeln(str);
end.

program Project12;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var N,a,b,i:byte;
ms:array[1..5,1..5]of boolean;

function check(i1,i2,i3:byte):boolean;
begin
  if (ms[i1,i2]and ms[i2,i3]and ms[i3,i1])or
     ((not ms[i1,i2])and(not ms[i1,i3])and(not ms[i3,i2]))
  then check:=true
  else check:=false;
end;

begin
  readln(N);
  for i:=1 to N do
  begin
  readln(a,b);
  ms[a,b]:=true;
  ms[b,a]:=true;
  end;
  if check(1,2,3)or
     check(1,2,4)or
     check(1,2,5)or
     check(1,3,4)or
     check(1,3,5)or
     check(1,4,5)or
     check(2,3,4)or
     check(2,3,5)or
     check(2,4,5)or
     check(3,4,5) then writeln('WIN')
     else writeln('FAIL');
end.

{$mode objfpc}
var
        count:integer;
        deg:array[1..5]of integer;
        c:array[1..5,1..5]of boolean;
        n,i,j,k:integer;
        x2,y1:integer;
begin
     readln(n);
     for k:=1 to n do
        begin
             readln(x2,y1);
             inc(deg[x2]);inc(deg[y1]);
        end;
     count:=0;
     for k:=1 to 5 do
        if (deg[k]>=3)or(deg[k]=0)or(deg[k]=1) then begin writeln('WIN'); halt;writeln; end;
     writeln('FAIL');
end.

VAR
	a:array[1..5,1..5] of boolean;
	t:array[1..5] of byte;
	f:array[1..5] of byte;
	n,b,c,i,j,g,k:byte;
BEGIN
	readln(n);
	fillchar(a,sizeof(a),false);g:=0;
	fillchar(t,sizeof(t),0);
	fillchar(f,sizeof(f),0);
	for i:=1 to n do
		BEGIN
			read(b,c);
			a[b,c]:=true;
			a[c,b]:=true;
		END;
	for i:=1 to 3 do
		for j:=i+1 to 4 do
			for k:=j+1 to 5 do
				BEGIN
					if (((a[i,j]) and (a[j,k])) and (a[i,k])) then
					BEGIN
						g:=1;
						break;
					END;
					if (((a[i,j]=FALSE) and (a[j,k]=FALSE)) and (a[i,k]=FALSE)) then
					BEGIN
						g:=1;
						break;
					END;
				END;
	if g=1 then
		writeln('WIN')
	else
		writeln('FAIL');
END.

var m,i,k,j,x,y:longint;
a:array[1..5,1..5]of longint;
begin
Read(m);
for i:=1 to m do
 begin
 Read(x,y);
 a[x,y]:=1;
 a[y,x]:=1;
 end;
for i:=1 to 5 do
 for k:=1 to 5 do
  for j:=1 to 5 do
   if (i<>k)and(i<>j)and(k<>j)and(a[i,k]=a[i,j])and(a[i,k]=a[k,j])and(a[i,j]=a[k,j])then
    begin
    Write('WIN');
    halt;
    end;
write('FAIL');
end.

// Allah is Great
{$H+,Q-,R-}
{$M 17777777}

uses
	SysUtils , Math;
const
	n = 5;
var
    m : longint;
    x : array[0 .. 5 , 0 .. 5] of integer;

procedure reading;
var
    i , j , k , a , b : longint;
begin
   read(m);
   for i:= 1 to m do begin
     read(a , b);
     x[a][b]:= 1;
     x[b][a]:= 1;
   end;
   for k:= 1 to n do begin
   	for j:= 1 to n do begin
   	        for i:= 1 to n do begin
   	        	if (i = j) or (i = k) or (j = k) then continue;
   	        	if (x[i][k] = 0) and (x[i][j] = 0) and (x[k][j] = 0) then begin
   	        		writeln('WIN'); exit;
   	        	end;
   	        end;
   	end;
   end;
   for k:= 1 to n do begin
   	for j:= 1 to n do begin
   	        for i:= 1 to n do begin
   	        	if (i = j) or (i = k) or (j = k) then continue;
   	        	if (x[i][k] = 1) and (x[i][j] = 1) and (x[k][j] = 1) then begin
   	        		writeln('WIN'); exit;
   	        	end;
   	        end;
   	end;
   end;
   writeln('FAIL');
end;

begin
   reading;
end.

var
 a:array [1..10000] of longint;
 i,j,n,m,k,ver1,ver2:longint;
begin
 readln(n);
 for i:=1 to n do
  begin
   readln(ver1,ver2);
   inc(a[ver1]);
   inc(a[ver2]);
  end;
 for i:=1 to 5 do
  begin
   if (a[i]>2) then begin
                       writeln('WIN');
                       halt;
                    end;
   if 4-a[i]>2 then begin
                     writeln('WIN');
                     halt;
                    end;
  end;
  writeln('FAIL');
end.

uses
    SysUtils, Math;

var
    i, j, k, m, x, y, cur : longint;
    a : array[0..10, 0..10] of boolean;

begin
{$IFNDEF ONLINE_JUDGE}
                reset(input, 'input.txt');
                rewrite(output, 'output.txt');
{$ENDIF}
    fillchar(a, sizeof(a), 0);
    read(m);
    for i := 1 to m do begin
        read(x, y);
        a[x][y] := true;
        a[y][x] := true;
    end;
    for i := 1 to 5 do
        for j := 1 to 5 do begin
            if i = j then continue;
            for k := 1 to 5 do begin
                if (i = k) or (j = k) then continue;
                cur := byte(a[i][j]) + byte(a[i][k]) + byte(a[j][k]);
                if (cur = 0) or (cur = 3) then begin
                    write('WIN');
                    halt(0);
                end;
            end;
        end;
    write('FAIL');
end.

var
    a: array[1..5, 1..5] of boolean;
    i, j, k, x, y, m: longint;

begin
    for i := 1 to 5 do
        for j := 1 to 5 do
            a[i, j] := false;

    read(m);
    for i := 1 to m do begin
        read(x, y);
        a[x, y] := true;
        a[y, x] := true;
    end;

    for i := 1 to 5 do
        for j := 1 to i-1 do
            for k := 1 to j-1 do
                if (a[i, j] and a[i, k] and a[j, k]) or (not a[i, j] and not a[i, k] and not a[j, k]) then begin
                    writeln('WIN');
                    halt;
                end;

    writeln('FAIL');
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var a:array [1..10,1..10]of longint;
    i,j,q:longint;
    x,y:longint;
    n,m:longint;

begin
  n:=5;
  readln(m);
  for i:=1 to m do
  begin
    readln(x,y);
    a[x,y]:=1;
    a[y,x]:=1;
  end;
  for i:=1 to n do
    for j:=i+1 to n do
      for q:=j+1 to n do
      begin
        if (a[i,j]=1)and(a[j,q]=a[i,j])and(a[i,q]=1) then
        begin
          write('WIN');
          halt(0);
        end else
        if (a[i,j]=0)and(a[j,q]=a[i,j])and(a[i,q]=0) then
        begin
          write('WIN');
          halt(0);
        end
      end;
  write('FAIL')
end.

var
	a: array[1..5, 1..5] of boolean;
	i, j, k, x, y, m: longint;

begin
	for i := 1 to 5 do
		for j := 1 to 5 do
			a[i, j] := false;

	read(m);
	for i := 1 to m do begin
		read(x, y);
		a[x, y] := true;
		a[y, x] := true;
	end;

	for i := 1 to 5 do
		for j := 1 to i-1 do
			for k := 1 to j-1 do
				if (a[i, j] and a[i, k] and a[j, k]) or (not a[i, j] and not a[i, k] and not a[j, k]) then begin
					writeln('WIN');
					halt;
				end;

	writeln('FAIL');
end.

var n,m,i,j,k,l,r,kol,ans:longint;
     a:Array[0..101,0..101] of longint;
begin
readln(m);
ans:=0;
n:=5;
for i:= 1 to m do
 begin
  readln(l,r);
  a[l,r]:=1;
  a[r,l]:=1;
 end;
 kol:=0;
  for i:= 1 to 5 do
   for j:= i+1 to 5 do
    for k:= j+1 to 5 do
     if (a[i,j]=1) and (a[i,k]=1) and (a[j,k]=1) then
     kol:=1;
     if kol=0 then inc(ans);
     kol:=0;
  for i:= 1 to 5 do
   for j:= i+1 to 5 do
    for k:= j+1 to 5 do
     if (a[i,j]=0) and (a[i,k]=0) and (a[j,k]=0) then
     kol:=1;
      if kol=0 then inc(Ans);
      if ans=2 then writeln('FAIL') else
      writeln('WIN');
end.

var
 a:array[1..5,1..5] of byte;
 b:array[1..3] of byte;
  i,j,m,n,t,z,x,y:longint;
 s1,s2:ansistring;

begin
// assign(input,'input.txt');reset(input);
// assign(output,'output.txt');rewrite(output);
 readln(m);
 for i:=1 to m do
  begin
   read(x,y);
   a[x,y]:=1;
   a[y,x]:=1;
  end;
  t:=0;m:=0;
 for i:=1 to 3 do
  for j:=i+1 to 4 do
   for z:=j+1 to 5 do
    if (a[i,j]=1)and(a[i,z]=1)and(a[j,z]=1) then t:=1;

 for i:=1 to 3 do
  for j:=i+1 to 4 do
   for z:=j+1 to 5 do
    if (a[i,j]=0)and(a[i,z]=0)and(a[j,z]=0) then m:=1;

 if (t=0)and(m=0) then write('FAIL')
                  else write('WIN');
end.

var
m, a, b, i, j, k: longint;
adj: array [1..5,1..5] of boolean;
begin
  readln(m);
  for i := 1 to m do
  begin
    readln(a, b);
    adj[a, b] := true;
    adj[b, a] := true;
  end;
  for i := 1 to 5 do
  begin
    for j := i + 1 to 5 do
    begin
      for k := j + 1 to 5 do
      begin
	if (adj[i, j] = adj[j, k]) and (adj[i, j] = adj[i, k]) then
	begin
	  writeln('WIN');
	  halt;
	end;
      end;
    end;
  end;
  writeln('FAIL');
end.

{$IFDEF NORMAL}
  {$H-,I+,OBJECTCHECKS-,Q-,R-,S-}
{$ENDIF NORMAL}
{$IFDEF DEBUG}
  {$H-,I+,OBJECTCHECKS+,Q+,R+,S-}
{$ENDIF DEBUG}
{$IFDEF RELEASE}
  {$H-,I-,OBJECTCHECKS-,Q-,R-,S-}
{$ENDIF RELEASE}
{$MODE OBJFPC}
{$COPERATORS ON}

const
    fi = '';
    fo = '';
var
    f : array [1..5 , 1..5] of boolean;
    a , b : array [1..5] of integer;
    n , i , i1 , i2 : integer;
    acq , unacq : boolean;
begin
    assign(input , fi);
    reset(input);
    assign(output , fo);
    rewrite(output);

    fillchar(f , sizeof(f) , false);
    for i := 1 to 5 do
        f[i][i] := true;
    read(n);
    for i := 1 to n do begin
        read(a[i] , b[i]);
        f[a[i]][b[i]] := true;
        f[b[i]][a[i]] := true;
    end;
    //
    acq := false;
    for i := 1 to 5 do begin
        for i1 := 1 to 5 do
            if (i1 <> i) and (f[i , i1]) then begin
                for i2 := 1 to 5 do
                    if (i1 <> i2) and (i <> i2) and ((f[i , i2]) and (f[i1 , i2])) then begin
                        acq := true;
                        break;
                    end;
                if (acq) then
                    break;
            end;
        if (acq) then
            break;
    end;
    unacq := false;
    for i := 1 to 5 do begin
        for i1 := 1 to 5 do
            if (i1 <> i) and (f[i , i1] = false) then begin
                for i2 := 1 to 5 do
                    if (i1 <> i2) and (i <> i2) and ((f[i , i2] = false) and (f[i1 , i2] = false)) then begin
                        unacq := true;
                        break;
                    end;
                if (unacq) then
                    break;
            end;
        if (unacq) then
            break;
    end;
    if (acq) or (unacq) then
        write('WIN')
    else
        write('FAIL');
end.

var a:array[1..5,1..5] of boolean;
    i,j,n,x,y,k:longint;
begin
for i:=1 to 5 do
 for j:=1 to 5 do a[i,j]:=false;
 read(n);
 for i:=1 to n do begin
  read(x,y);
  a[x,y]:=true;
  a[y,x]:=true;
 end;
 for i:=1 to 5 do
  for j:=1 to i-1 do
   for k:=1 to j-1 do begin
    if (a[i,j] and a[i,k] and a[j,k]) or (not a[i,j] and not a[i,k] and not a[j,k]) then begin
     write('WIN');
     exit;
    end;
   end;
write('FAIL');
end.

const
        finp = '';
        fout = '';
var
        fi, fo : text;
        a : array[1 .. 5, 1 .. 5] of integer;
        res : string;
{----------------}
procedure OpenFile;
begin
        assign(fi, finp);
        reset(fi);

        assign(fo, fout);
        rewrite(fo);
end;
{----------------}
procedure Init;
begin
        fillchar(a, sizeof(a), 0);
end;
{----------------}
procedure Input;
var
        i : integer;
        x, y : integer;
begin
        readln(fi, i);
        for i := 1 to i do
        begin
                readln(fi, x, y);
                a[x, y] := 1;
                a[y, x] := 1;
        end;
end;
{----------------}
procedure Solve;
var
        i, j, k : integer;
begin
        res := 'FAIL';
        for i := 1 to 3 do
        for j := i + 1 to 4 do
        for k := j + 1 to 5 do
        if ((a[i, j] = 0) and (a[i, k] = 0) and (a[j, k] = 0))
        or ((a[i, j] = 1) and (a[i, k] = 1) and (a[j, k] = 1)) then
        begin
                res := 'WIN';
                exit;
        end;
end;
{----------------}
procedure Output;
begin
        writeln(fo, res);
end;
{----------------}
procedure Process;
begin
        Init;
        Input;
        Solve;
        Output;
end;
{----------------}
procedure CloseFile;
begin
        close(fi);
        close(fo);
end;
{----------------}
begin
        OpenFile;
        Process;
        CloseFile;
end.

var
  x, y, m, i, j, k: longint;
  a: array[1..5, 1..5] of longint;
begin
  {assign(input, 'input.txt');
  assign(output, 'output.txt');
  reset(input);
  rewrite(output);}
  readln(m);
  for i := 1 to m do
  begin
    readln(x, y);
    a[x, y] := 1;
    a[y, x] := 1;
  end;
  for i := 1 to 5 do
  begin
    for j := i + 1 to 5 do
    begin
      for k := j + 1 to 5 do
      begin
        if ((a[i, j] = 1) and (a[i, k] = 1) and (a[j, k] = 1)) or ((a[i, j] = 0) and (a[i, k] = 0) and (a[j, k] = 0)) then
        begin
          writeln('WIN');
          exit;
        end;
      end;
    end;
  end;
  writeln('FAIL');
end.

var fr:array[1..10,1..10] of integer;
    k_z:array [1..5] of integer;
    m,mm,n,i:longint;
    fl:boolean;
begin
 readln(n);
if n<4 then writeln('WIN')
else
begin
 for i:=1 to n do
  readln(fr[i,1],fr[i,2]);
 for i:=1 to n do
  begin inc(k_z[fr[i,1]]);inc(k_z[fr[i,2]]);end;
  fl:=false;
 for i:=1 to 5 do
  if (k_z[i]<>2) then fl:=true;
 if fl=true then writeln('WIN')
            else writeln('FAIL');
end;
end.

var
 c:array[1..5,1..5]of byte;
 i,j,n,a,b,z:longint;
begin
 readln(n);
 for i:=1 to n do
 begin
  readln(a,b);
  c[a,b]:=1;
  c[b,a]:=1;
 end;
 for i:=1 to 3 do
 for j:=i+1 to 4 do
 for z:=j+1 to 5 do
 begin
  if ((c[i,j]=0)and(c[i,z]=0)and(c[j,z]=0))
  or((c[i,j]=1)and(c[i,z]=1)and(c[j,z]=1)) then
  begin
   writeln('WIN');
   halt;
  end;
 end;
 writeln('FAIL');
end.
{ for i:=1 to 5 do
 begin
  for j:=1 to 5 do if c[i,j]=1 then inc(g);
  if g    }

Var n,m,i,j,x,y,u:longint;
  a:array[0..123,0..123]of longint;
  begin
    read(m);
    for i:=1 to m do
      begin
        read(x,y);
        a[x,y]:=1;
        a[y,x]:=1;
      end;
    for i:=1 to 5 do
      for j:=1 to 5 do
        for u:=1 to 5 do
          if (i<>j)and(i<>u)and(j<>u)and((a[i,j]+a[j,u]+a[i,u])mod 3=0)
            then begin
                   Writeln('WIN');
                   halt(0);
                 end;
    Writeln('FAIL');
  end.

program z;
 var
  a:array[1..5,1..5] of byte;
  i,j,k,n,m,x,y:integer;
 begin
  fillchar(a,sizeof(a),0);
  read(n);
  for i:=1 to n do
   begin
    read(x,y);
    a[x,y]:=1;
    a[y,x]:=1;
   end;
  m:=0;
  for i:=1 to 5 do
   a[i][i]:=2;
  for i:=1 to 5 do
   for j:=1 to 5 do
    for k:=1 to 5 do
     begin
      if (a[i,j]=0)and(a[i,k]=0)and(a[j,k]=0) then m:=1;
     end;
  for i:=1 to 5 do
   for j:=1 to 5 do
    for k:=1 to 5 do
     begin
      if (a[i,j]=1)and(a[i,k]=1)and(a[j,k]=1) then m:=1;
     end;
  if m=1 then write('WIN') else write('FAIL');
end.

var
m,x,y,i,j,k:integer;
a:array [1..5,1..5] of integer;
f1,f2:boolean;
begin
readln (m);
for i:=1 to m do
        for j:=1 to m do
                a[i,j]:=0;
for i:=1 to m do
        begin
                readln (x,y);
                a[x,y]:=1;
                a[y,x]:=1;
        end;
for i:=1 to 5 do
        for j:=1 to 5 do
                for k:=1 to 5 do
                        if (i<>j) and (j<>k) and (i<>k) then
                                begin
                                        if (a[i,j]=a[j,k]) and (a[i,k]=a[i,j]) and (a[i,j]=1) then
                                                f1:=true;
                                        if (a[i,j]=a[j,k]) and (a[i,k]=a[i,j]) and (a[i,j]=0) then
                                                f2:=true;
                                end;
if f1 or f2 then
        writeln ('WIN')
else
        writeln ('FAIL');
end.

const
{     fi='friends.inp';
     fo='friends.out'; }
     fi='';
     fo='';

var
     f:text;
     a:array[0..5,0..5]of boolean;
     x:array[0..3]of byte;
     free:array[0..5]of boolean;
     n:byte;
     kq:boolean;

procedure open;
var  i,u,v:byte;
begin
     assign(f,fi);reset(f);
     readln(f,n);
     for i:=1 to n do
     begin
          readln(f,u,v);
          a[u,v]:=true;
          a[v,u]:=true;
     end;
     close(f);
end;

procedure check;
var  i,j,dem:byte;
begin
     dem:=0;
     for i:=1 to 2 do
          for j:=i+1 to 3 do
               if a[x[i],x[j]] then inc(dem);
     if (dem=0) or (dem=3) then kq:=true;
end;

procedure try(i:byte);
var  j:byte;
begin
     if i>3 then check
     else
     begin
          for j:=1 to 5 do
               if free[j] then
               begin
                    x[i]:=j;
                    free[j]:=false;
                    try(i+1);
                    free[j]:=true;
               end;
     end;

end;

procedure main;
begin
     fillchar(free,sizeof(free),true);
     try(1);
     assign(f,fo);rewrite(f);
     if not kq then writeln(f,'FAIL')
     else writeln(f,'WIN');
     close(f);
end;

begin
     open;
     main;
end.

var
   ar : array[1..5,1..5] of boolean;
   ar2 : array[1..5] of longint;
   bol : boolean;
   k,i,j,l,a,b : byte;
begin
   readln(k);
   fillchar(ar,sizeof(ar),false);
   for i := 1 to k do
     begin
        readln(a,b);
        ar[a][b] := true;
        ar[b][a] := true;
     end;
   for i := 1 to 5 do
     ar[i][i] := false;
   bol := false;
   for i := 1 to 3 do
     begin
        for j := i+1 to 4 do
          begin
             for k := j+1 to 5 do
               begin
                  if ar[i][j] and ar[i][k] and ar[j][k] then bol := true;
                  if not(ar[i][j]) and not(ar[i][k]) and not(ar[j][k]) then bol := true;
               end;
          end;
     end;
   if bol then writeln('WIN')
   else writeln('FAIL');
end.

type matrica=array[1..5,1..5]of integer;
var a,b:matrica;
    n,i,j,u,v,m,ans,h,pr:integer;
    fix:array[1..5]of integer;

Procedure dfs(a:matrica;k,l:integer);
var i,pv:integer;
begin
fix[k]:=l;
pv:=pr;
for i:=1 to n do
 if(pr<>i)and(a[k,i]=1)then
  begin
   if(fix[i]=0)or(fix[i]>fix[k]+1)then
                   begin
                     pr:=k;
                     dfs(a,i,fix[k]+1);
                     pr:=pv;
                    end else
   if(l-fix[i]=2)then begin
                       ans:=ans+1;
                       exit;
                      end;
  end;
end;
begin
n:=5;
readln(m);
for i:=1 to m do
 begin
  readln(u,v);
  a[u,v]:=1;
  a[v,u]:=1;
 end;
for i:=1 to n do
 for j:=1 to n do
  if(i<>j)then
   if(a[i,j]=0)then b[i,j]:=1;
for i:=1 to n do
 if(fix[i]=0)then dfs(b,i,1);
if ans=0 then begin
               for i:=1 to n do fix[i]:=0;
               for i:=1 to n do
                if(fix[i]=0)then dfs(a,i,1);
              end;
if(ans>0)then writeln('WIN')
         else writeln('FAIL');
end.

var
        n,a,b,i:longint;
        g:array [1..5] of longint;
begin
        readln(n);
        for i:=1 to n do
        begin
                readln(a,b);
                inc(g[a]); inc(g[b]);
        end;
        for i:=1 to 5 do
        if g[i]<>2 then
        begin
                writeln('WIN');
                halt;
        end;
        writeln('FAIL');
end.

var
 k : array [0..11,0..11] of boolean;
 l,n,i,j,m,h,c,x,y,z : longint;
 s,p,ss,t : string;
begin
 readln(n);
 for i:=1 to n do
 begin
  readln(x,y);
  k[x,y]:=true;
  k[y,x]:=true;
 end;
 x:=0;
 z:=0;
 for i:=1 to 5 do for j:=i+1 to 5 do if not k[i,j] then for l:=j+1 to 5 do if (not k[j,l])and(not k[i,l]) then
 begin
  writeln('WIN');
  halt;
 end;
 for i:=1 to 5 do for j:=i+1 to 5 do if k[i,j] then for l:=j+1 to 5 do if (k[j,l])and(k[i,l]) then
 begin
  writeln('WIN');
  halt;
 end;
 writeln('FAIL');
end.

var n,i,j,k,A,B:longint;
w:array[1..5,1..5] of longint;
begin
read(n);
for i:=1 to n do
begin
read(a,b);
w[a,b]:=1;
w[b,a]:=1;
end;
for i:=1 to 5 do
for j:=i+1 to 5 do
for k:=j+1 to 5 do
begin
if w[i,j]*w[j,k]*w[i,k]=1 then begin
write('WIN');
halt;
end;
if w[i,j]+w[j,k]+w[i,k]=0 then begin
write('WIN');
halt;
end;
end;
write('FAIL');
end.

var
a:array[1..5,1..5]of integer;
n,i,j,l,x,y:integer;
q:boolean;
begin
readln(n);
for i:=1 to n do
        begin
        readln(x,y);
        a[x,y]:=1; a[y,x]:=1;
        end;
q:=false;
for i:=1 to 5 do
for j:=i+1 to 5 do
for l:=j+1 to 5 do
if ((a[i,j]=1)and(a[i,l]=1)and(a[j,l]=1))or
        ((a[i,j]=0)and(a[i,l]=0)and(a[j,l]=0)) then q:=true;
if q then writeln('WIN') else writeln('FAIL');
end.

var
o1,o2:boolean;
i,x,y,m:longint;
e,a:array[0..100]of longint;

procedure run(v,t,mask:longint);
 begin
  if v=5 then
    begin
     if t=3 then
       begin
        o1:=false;
        o2:=false;
        for i:=1 to t do
          if (a[e[i]] and mask)=mask then o1:=true
                else if (a[e[i]] and mask)=0 then o2:=true else exit;

        writeln('WIN');
        halt(0);
       end;
     exit;
    end;
  run(v+1,t,mask);
  e[t+1]:=v;
  run(v+1,t+1,mask or (1 shl v));
 end;

 begin
  read(m);
  for i:=1 to m do
    begin
     read(x,y);
     x:=x-1;
     y:=y-1;
     a[x]:=a[x] or (1 shl y);
     a[y]:=a[y] or (1 shl x);
    end;

  run(0,0,0);
  writeln('FAIL');
 end.

var x,y,n,i:longint;
ans:boolean;
    a:array[1..1000]of longint;
begin
readln(n);
for i:=1 to n do
  begin
    readln(x,y);
    inc(a[x]);
    inc(a[y]);
  end;
ans:=false;
for i:=1 to 5 do
  if a[i]>=3 then begin ans:=true;break; end;
if ans=true then write('WIN')
else write('FAIL');
end.

var
m:array [1..5] of integer;
n,i,a,b:longint;
begin
read(n);
for i:=1 to 5 do m[i]:=0;
for i:=1 to n do begin read(a,b); inc(m[a]); inc(m[b]); end;
a:=0; b:=0;
for i:=1 to 5 do if m[i]<3 then inc(a) else inc(b);
if (a>2) or (b>2) then write('WIN') else write('FAIL');
end.

var
m:array [1..5] of integer;
n,i,a,b:longint;
begin
read(n);
for i:=1 to 5 do m[i]:=0;
for i:=1 to n do begin read(a,b); inc(m[a]); inc(m[b]); end;
a:=0; b:=0;
for i:=1 to 5 do if m[i]>2 then inc(a) else if m[i]<2 then inc(b);
if (a>2) or (b>2) then write('WIN') else write('FAIL');
end.

var
m:array [1..5] of integer;
n,i,a,b:longint;
begin
read(n);
for i:=1 to 5 do m[i]:=0;
for i:=1 to n do begin read(a,b); inc(m[a]); inc(m[b]); end;
a:=0; b:=0;
for i:=1 to n do if m[i]>2 then inc(a) else if m[i]<2 then inc(b);
if (a>2) or (b>2) then write('WIN') else write('FAIL');
write(a,' ',b);
end.

{$mode objfpc}
var
        count:integer;
        deg:array[1..5]of integer;
        c:array[1..5,1..5]of boolean;
        n,i,j,k:integer;
        x2,y1:integer;
begin
     readln(n);
     for k:=1 to n do
        begin
             readln(x2,y1);
             inc(deg[x2]);inc(deg[y1]);
        end;
     count:=0;
     for k:=1 to 5 do
        if deg[k]>=3 then begin writeln('WIN'); halt;writeln; end;
     writeln('FAIL');
end.

{$mode objfpc}
var
        count:integer;
        deg:array[1..5]of integer;
        c:array[1..5,1..5]of boolean;
        n,i,j,k:integer;
        x2,y1:integer;
begin
     readln(n);
     for k:=1 to n do
        begin
             readln(x2,y1);
             inc(deg[x2]);inc(deg[y1]);
        end;
     count:=0;
     for k:=1 to 5 do
        if (deg[k]>=3)or(deg[k]=0) then begin writeln('WIN'); halt;writeln; end;
     writeln('FAIL');
end.

{$mode objfpc}
var
        count:integer;
        deg:array[1..5]of integer;
        c:array[1..5,1..5]of boolean;
        m,i,j,k:integer;
        x,y:integer;
begin
     readln(m);
     for i:=1 to m do
        begin
             readln(x,y);
             c[x,y]:=true;
             c[y,x]:=true;
             inc(deg[x]);inc(deg[y]);
        end;
     count:=0;
     for i:=1 to 5 do
        if deg[i]>=3 then begin writeln('WIN'); halt; end;
     writeln('FALL');
end.

{$mode objfpc}
var
        count:integer;
        deg:array[1..5]of integer;
        c:array[1..5,1..5]of boolean;
        m,i,j,k:integer;
        x,y,dd:integer;
begin
     readln(m);
     for i:=1 to m do
        begin
             readln(x,y);
             c[x,y]:=true;
             c[y,x]:=true;
             inc(deg[x]);inc(deg[y]);
        end;
     count:=0;
     for i:=1 to 5 do
        if deg[i]>=3 then begin writeln('WIN'); halt;writeln; end;
     writeln('FALL');
end.

{$mode objfpc}
var
        count:integer;
        deg:array[1..5]of integer;
        c:array[1..5,1..5]of boolean;
        n,i,j:integer;
        x2,y1:integer;
begin
     readln(n);
     for i:=1 to n do
        begin
             readln(x2,y1);
             inc(deg[x2]);inc(deg[y1]);
        end;
     count:=0;
     for i:=1 to 5 do
        if deg[i]>=3 then begin writeln('WIN'); halt;writeln; end;
     writeln('FAIL');
end.

VAR
	a:array[1..5,1..5] of boolean;
	t:array[1..5] of byte;
	f:array[1..5] of byte;
	n,b,c,i,j,count,g:byte;
BEGIN
	readln(n);
	fillchar(a,sizeof(a),false);count:=0;g:=0;
	fillchar(t,sizeof(t),0);
	fillchar(f,sizeof(f),0);
	for i:=1 to n do
		BEGIN
			read(b,c);
			a[b,c]:=true;
			a[c,b]:=true;
		END;
	for i:=1 to 5 do
		BEGIN
		for j:=1 to 5 do
			BEGIN
				inc(count);
				if (i<>j) then
				if a[i,j]=TRUE then
					inc(t[i])
				else
					inc(f[i]);
			END;
	if (t[i]=3) OR (f[i]=3) then
			BEGIN
				writeln('WIN');g:=1;
				break;
			END;
		END;
	if g=0 then
		writeln('FAIL');
END.

var
	N,i,a,b,c,j,d,k : integer;
	g : array [1..5,1..5] of boolean;

begin
	readln(N);

	for i := 1 to N do
	begin
		readln(a,b);
		g[a,b] := true;
		g[b,a] := true;
	end;

	for i := 1 to 5 do
	begin
		c := 0;
		d := 0;

		for j := 1 to 5 do
		begin
			if i <> j then
				if g[i,j] then
					for k := 1 to 5 do
						if (k <> j) and (k <> i) then
							if (g[j,k]) and (g[j,i]) then inc(c);
			if (c = 3) then
			begin
				writeln('WIN');
				halt;
			end;
		end;

		for j := 1 to 5 do
		begin
			if i <> j then
				if not(g[i,j]) then
					for k := 1 to 5 do
						if (k <> j) and (k <> i) then
							if not(g[j,k]) and not(g[j,i]) then inc(d);

			if (d = 3) then
			begin
				writeln('WIN');
				halt;
			end;
		end;

	end;

	writeln('FAIL');

end.

var
	N,i,a,b,c,d,j : integer;
	v : array [1..5,1..5] of boolean;

begin
	readln(N);

	for i := 1 to N do
	begin
		readln(a,b);
		v[a,b] := true;
		v[b,a] := true;
	end;

	for i := 1 to 5 do
	begin
		c := 0; d := 0;
		for j := 1 to 5 do
			if i <> j then
				if v[i,j] then inc(c) else inc(d);
		if (c = 3) or (d = 3) then
		begin
			writeln('WIN');
			halt;
		end;
	end;

	writeln('FAIL');

end.

var a, b, m, i, j, k: byte;
    x: array [1..5, 1..5] of boolean;
begin
        readln(m);
        for i := 1 to m do
        begin
                readln(a, b);
                x[a, b] := true;
                x[a, b] := true;
        end;
        for i := 1 to 3 do
                for j := i + 1 to 4 do
                        for k := j + 1 to 5 do
                                if (x[i, j] = x[j, k]) and (x[j, k] = x[k, i]) then
                                begin
                                        writeln('WIN');
                                        exit;
                                end;
        writeln('FAIL');
end.

{$IFDEF NORMAL}
  {$H-,I+,OBJECTCHECKS-,Q-,R-,S-}
{$ENDIF NORMAL}
{$IFDEF DEBUG}
  {$H-,I+,OBJECTCHECKS+,Q+,R+,S-}
{$ENDIF DEBUG}
{$IFDEF RELEASE}
  {$H-,I-,OBJECTCHECKS-,Q-,R-,S-}
{$ENDIF RELEASE}
{$MODE OBJFPC}
{$COPERATORS ON}

const
    fi = '';
    fo = '';
var
    f : array [1..5 , 1..5] of boolean;
    a , b : array [1..5] of integer;
    n , i , i1 , i2 : integer;
    acq , unacq : boolean;
begin
    assign(input , fi);
    reset(input);
    assign(output , fo);
    rewrite(output);

    fillchar(f , sizeof(f) , false);
    for i := 1 to 5 do
        f[i][i] := true;
    read(n);
    for i := 1 to n do begin
        read(a[i] , b[i]);
        f[a[i]][b[i]] := true;
        f[b[i]][a[i]] := true;
    end;
    //
    acq := false;
    for i := 1 to 5 do begin
        for i1 := 1 to 5 do
            if (i1 <> i) and (f[i , i1]) then begin
                for i2 := 1 to 5 do
                    if (i1 <> i2) and (i <> i2) and ((f[i , i1]) and (f[i1 , i2])) then begin
                        acq := true;
                        break;
                    end;
                if (acq) then
                    break;
            end;
        if (acq) then
            break;
    end;
    unacq := false;
    for i := 1 to 5 do begin
        for i1 := 1 to 5 do
            if (i1 <> i) and (f[i , i1] = false) then begin
                for i2 := 1 to 5 do
                    if (i1 <> i2) and (i <> i2) and ((f[i , i2] = false) and (f[i1 , i2] = false)) then begin
                        unacq := true;
                        break;
                    end;
                if (unacq) then
                    break;
            end;
        if (unacq) then
            break;
    end;
    if (acq) and (unacq) then
        write('WIN')
    else
        write('FAIL');
end.

{$IFDEF NORMAL}
  {$H-,I+,OBJECTCHECKS-,Q-,R-,S-}
{$ENDIF NORMAL}
{$IFDEF DEBUG}
  {$H-,I+,OBJECTCHECKS+,Q+,R+,S-}
{$ENDIF DEBUG}
{$IFDEF RELEASE}
  {$H-,I-,OBJECTCHECKS-,Q-,R-,S-}
{$ENDIF RELEASE}
{$MODE OBJFPC}
{$COPERATORS ON}

const
    fi = '';
    fo = '';
var
    f : array [1..5 , 1..5] of boolean;
    a , b : array [1..5] of integer;
    n , i , i1 , i2 : integer;
    acq , unacq : boolean;
begin
    assign(input , fi);
    reset(input);
    assign(output , fo);
    rewrite(output);

    fillchar(f , sizeof(f) , false);
    read(n);
    for i := 1 to n do begin
        read(a[i] , b[i]);
        f[a[i]][b[i]] := true;
        f[b[i]][a[i]] := true;
    end;
    //
    acq := false;
    for i := 1 to 5 do begin
        for i1 := 1 to 5 do
            if (i1 <> i) and (f[i , i1]) then begin
                for i2 := 1 to 5 do
                    if (i1 <> i2) and (i <> i2) and ((f[i , i1]) or (f[i1 , i2])) then begin
                        acq := true;
                        break;
                    end;
                if (acq) then
                    break;
            end;
        if (acq) then
            break;
    end;
    unacq := false;
    for i := 1 to 5 do begin
        for i1 := 1 to 5 do
            if (i1 <> i) and (f[i , i1] = false) then begin
                for i2 := 1 to 5 do
                    if (i1 <> i2) and (i <> i2) and (f[i , i2] = false) and (f[i1 , i2] = false) then begin
                        unacq := true;
                        break;
                    end;
                if (unacq) then
                    break;
            end;
        if (unacq) then
            break;
    end;
    if (acq) and (unacq) then
        write('WIN')
    else
        write('FAIL');
end.

{$IFDEF NORMAL}
  {$H-,I+,OBJECTCHECKS-,Q-,R-,S-}
{$ENDIF NORMAL}
{$IFDEF DEBUG}
  {$H-,I+,OBJECTCHECKS+,Q+,R+,S-}
{$ENDIF DEBUG}
{$IFDEF RELEASE}
  {$H-,I-,OBJECTCHECKS-,Q-,R-,S-}
{$ENDIF RELEASE}
{$MODE OBJFPC}
{$COPERATORS ON}

const
    fi = '';
    fo = '';
var
    f : array [1..5 , 1..5] of boolean;
    a , b : array [1..5] of integer;
    n , i , i1 , i2 : integer;
    acq , unacq : boolean;
begin
    assign(input , fi);
    reset(input);
    assign(output , fo);
    rewrite(output);

    fillchar(f , sizeof(f) , false);
    for i := 1 to 5 do
        f[i][i] := true;
    read(n);
    for i := 1 to n do begin
        read(a[i] , b[i]);
        f[a[i]][b[i]] := true;
        f[b[i]][a[i]] := true;
    end;
    //
    acq := false;
    for i := 1 to 5 do begin
        for i1 := 1 to 5 do
            if (i1 <> i) and (f[i , i1]) then begin
                for i2 := 1 to 5 do
                    if (i1 <> i2) and (i <> i2) and ((f[i , i1]) and (f[i1 , i2])) then begin
                        acq := true;
                        break;
                    end;
                if (acq) then
                    break;
            end;
        if (acq) then
            break;
    end;
    unacq := false;
    for i := 1 to 5 do begin
        for i1 := 1 to 5 do
            if (i1 <> i) and (f[i , i1] = false) then begin
                for i2 := 1 to 5 do
                    if (i1 <> i2) and (i <> i2) and ((f[i , i2] = false) or (f[i1 , i2] = false)) then begin
                        unacq := true;
                        break;
                    end;
                if (unacq) then
                    break;
            end;
        if (unacq) then
            break;
    end;
    if (acq <> unacq) then
        write('WIN')
    else
        write('FAIL');
end.

{$IFDEF NORMAL}
  {$H-,I+,OBJECTCHECKS-,Q-,R-,S-}
{$ENDIF NORMAL}
{$IFDEF DEBUG}
  {$H-,I+,OBJECTCHECKS+,Q+,R+,S-}
{$ENDIF DEBUG}
{$IFDEF RELEASE}
  {$H-,I-,OBJECTCHECKS-,Q-,R-,S-}
{$ENDIF RELEASE}
{$MODE OBJFPC}
{$COPERATORS ON}

const
    fi = '';
    fo = '';
var
    f : array [1..5 , 1..5] of boolean;
    a , b : array [1..5] of integer;
    n , i , i1 , i2 : integer;
    acq , unacq : boolean;
begin
    assign(input , fi);
    reset(input);
    assign(output , fo);
    rewrite(output);

    fillchar(f , sizeof(f) , false);
    for i := 1 to 5 do
        f[i][i] := true;
    read(n);
    for i := 1 to n do begin
        read(a[i] , b[i]);
        f[a[i]][b[i]] := true;
        f[b[i]][a[i]] := true;
    end;
    //
    acq := false;
    for i := 1 to 5 do begin
        for i1 := 1 to 5 do
            if (i1 <> i) and (f[i , i1]) then begin
                for i2 := 1 to 5 do
                    if (i1 <> i2) and (i <> i2) and ((f[i , i1]) and (f[i1 , i2])) then begin
                        acq := true;
                        break;
                    end;
                if (acq) then
                    break;
            end;
        if (acq) then
            break;
    end;
    unacq := false;
    for i := 1 to 5 do begin
        for i1 := 1 to 5 do
            if (i1 <> i) and (f[i , i1] = false) then begin
                for i2 := 1 to 5 do
                    if (i1 <> i2) and (i <> i2) and ((f[i , i2] = false) or (f[i1 , i2] = false)) then begin
                        unacq := true;
                        break;
                    end;
                if (unacq) then
                    break;
            end;
        if (unacq) then
            break;
    end;
    if (acq) and (unacq) then
        write('WIN')
    else
        write('FAIL');
end.

{$IFDEF NORMAL}
  {$H-,I+,OBJECTCHECKS-,Q-,R-,S-}
{$ENDIF NORMAL}
{$IFDEF DEBUG}
  {$H-,I+,OBJECTCHECKS+,Q+,R+,S-}
{$ENDIF DEBUG}
{$IFDEF RELEASE}
  {$H-,I-,OBJECTCHECKS-,Q-,R-,S-}
{$ENDIF RELEASE}
{$MODE OBJFPC}
{$COPERATORS ON}

const
    fi = '';
    fo = '';
var
    f : array [1..5 , 1..5] of boolean;
    a , b : array [1..5] of integer;
    n , i , i1 , i2 : integer;
    acq , unacq : boolean;
begin
    assign(input , fi);
    reset(input);
    assign(output , fo);
    rewrite(output);

    fillchar(f , sizeof(f) , false);
    read(n);
    for i := 1 to n do begin
        read(a[i] , b[i]);
        f[a[i]][b[i]] := true;
        f[b[i]][a[i]] := true;
    end;
    //
    acq := false;
    for i := 1 to 5 do begin
        for i1 := 1 to 5 do
            if (i1 <> i) and (f[i , i1]) then begin
                for i2 := 1 to 5 do
                    if (i1 <> i2) and (i <> i2) and ((f[i , i1]) or (f[i1 , i2])) then begin
                        acq := true;
                        break;
                    end;
                if (acq) then
                    break;
            end;
        if (acq) then
            break;
    end;
    unacq := false;
    for i := 1 to 5 do begin
        for i1 := 1 to 5 do
            if (i1 <> i) and (f[i , i1] = false) then begin
                for i2 := 1 to 5 do
                    if (i1 <> i2) and (i <> i2) and (f[i , i2] = false) and (f[i1 , i2] = false) then begin
                        unacq := true;
                        break;
                    end;
                if (unacq) then
                    break;
            end;
        if (unacq) then
            break;
    end;
    if (acq) or (unacq) then
        write('WIN')
    else
        write('FAIL');
end.

var fr:array[1..10,1..10] of integer;
    k_z:array [1..10] of integer;
    n,i:longint;
    fl:boolean;
begin
 readln(n);
if n<4 then writeln('WIN')
else
begin
 for i:=1 to n do
  readln(fr[i,1],fr[i,2]);
 for i:=1 to n do
  begin inc(k_z[fr[i,1]]);inc(k_z[fr[i,2]]);end;
  fl:=false;
 for i:=1 to 10 do
  if k_z[i]>=3 then fl:=true;
 if fl=true then writeln('WIN')
            else writeln('FAIL');
end;
end.

var fr:array[1..10,1..10] of integer;
    k_z:array [1..10] of integer;
    n,i:longint;
    fl:boolean;
begin
 readln(n);
 for i:=1 to n do
  readln(fr[i,1],fr[i,2]);
 for i:=1 to n do
  begin inc(k_z[fr[i,1]]);inc(k_z[fr[i,2]]);end;
  fl:=false;
 for i:=1 to 10 do
  if k_z[i]>=3 then fl:=true;
 if fl=true then writeln('WIN')
            else writeln('FAIL');
end.

var fr:array[1..10,1..10] of integer;
    k_z:array [1..10] of integer;
    n,i:longint;
    fl:boolean;
begin
 readln(n);
if n<3 then writeln('WIN')
else
begin
 for i:=1 to n do
  readln(fr[i,1],fr[i,2]);
 for i:=1 to n do
  begin inc(k_z[fr[i,1]]);inc(k_z[fr[i,2]]);end;
  fl:=false;
 for i:=1 to 10 do
  if k_z[i]>=3 then fl:=true;
 if fl=true then writeln('WIN')
            else writeln('FAIL');
end;
end.

var n,i,p:longint;
z:longint;
s:string;
q:array[0..1000000] of string;
ans:array[0..1000000] of longint;
begin                        {
assign(input,'input.txt');
reset(input);
assign(output,'output.txt');
rewrite(output);            }
readln(n);
for z:=1 to n do
        begin
         readln(s);
         p:=0;
         for i:=1 to length(s) do
                p:=(p+(i*ord(s[i]))) mod 10000000;
         if ans[p]=0 then begin writeln('OK');q[p]:=s;ans[p]:=1;end
         else
         begin
           writeln(q[p],ans[p]);
           inc(ans[p]);
         end;
        end;
end.

var i,j,a,c,d,n,e,q,s,k1,k2:longint;  mas:array[1..5,1..5] of longint;
begin

readln(n);

fillchar(mas,sizeof(mas),0);

for i:=1 to n do
begin
readln(q,s);
mas[q,s]:=mas[q,s]+1;
mas[s,q]:=mas[s,q]+1;
end;

for i:=1 to 5 do
mas[i,i]:=2;

for i:=1 to 5 do
begin
k1:=0;
k2:=0;
for j:=1 to 5 do
begin
if mas[i,j]=0 then k1:=k1+1;
if mas[i,j]=1 then k2:=k2+1;
end;
if (k1=3) or (k2=3) then begin writeln('WIN'); exit; end;
end;

writeln('FAIL');

end.

var i,j,a,c,d,n,e,q,s,k1,k2:longint;  mas:array[1..5,1..5] of longint;
begin

readln(n);

fillchar(mas,sizeof(mas),0);

for i:=1 to n do
begin
readln(q,s);
mas[q,s]:=mas[q,s]+1;
mas[s,q]:=mas[s,q]+1;
end;

for i:=1 to 5 do
mas[i,i]:=1;

for i:=1 to 5 do
for j:=1 to 5 do
begin
if mas[i,j]=0 then k1:=k1+1 else k2:=k2+1;
end;

k1:=k1 div 2;
k2:=(k2-5) div 2;

if (k1=3) or (k2=3) then writeln('WIN') else writeln('FAIL');

end.

var i,a,c,d,n,e,s,q:longint;  mas:array[1..100] of longint;
begin

readln(n);

for i:=1 to n do
begin
readln(s,q);
mas[s]:=mas[s]+1;
mas[q]:=mas[q]+1;
end;

if n=7 then e:=1;

for i:=1 to 5 do
if mas[i]=3 then e:=1;

if e=1 then writeln('WIN') else writeln('FAIL');

end.

program z;
 var
  a:array[1..20] of byte;
  b:array[1..5] of integer;
  n,i,p:integer;
 begin
  read(n);
  n:=n*2;
  for i:=1 to n do
   begin
    read(a[i]);
   end;
  fillchar(b,sizeof(b),0);
  for i:=1 to n do
   begin
    if a[i]=1 then inc(b[1]);
    if a[i]=2 then inc(b[2]);
    if a[i]=3 then inc(b[3]);
    if a[i]=4 then inc(b[4]);
    if a[i]=5 then inc(b[5]);
   end;
  p:=0;
  for i:=1 to 5 do
   if b[i]>=3 then p:=1;
  if p=0 then write('FAIL') else write('WIN');
end.

const
    finp='';
    fout='';
var dau:array [1..10] of string;
    x,y,z,n,i,LC1,LC2,LC3:longint;
    KQ,s1,s2,s3:string;
    f,g:text;
begin
    assign(f,finp); reset(f);
    assign(g,fout); rewrite(g);
    readln(f,n);
    for i:=1 to n do
        begin
            readln(f,x,y);
            str(x,s1); str(y,s2);
            insert(s2,dau[x],length(dau[x])+1);
            insert(s1,dau[y],length(dau[y])+1);
        end;
    for x:=1 to 5 do
        for y:=1 to 5 do
            for z:=1 to 5 do
                begin
                    str(x,s1); str(y,s2); str(z,s3); LC1:=0; LC2:=0; LC3:=0;
                    if not ((x=y) or (y=z) or (z=x)) then
                        begin
                            if (pos(s1,dau[y])<>0) and (pos(s1,dau[z])<>0) then LC1:=1
                            else
                                if (pos(s1,dau[y])<>0) or (pos(s1,dau[z])<>0) then LC1:=2;
                            if (pos(s2,dau[x])<>0) and (pos(s2,dau[z])<>0) then LC2:=1
                            else
                                if (pos(s2,dau[x])<>0) or (pos(s2,dau[z])<>0) then LC2:=2;
                            if (pos(s3,dau[y])<>0) and (pos(s3,dau[x])<>0) then LC3:=1
                            else
                                if (pos(s3,dau[y])<>0) or (pos(s3,dau[x])<>0) then LC3:=2;
                            if (LC1=LC2) and (LC2=LC3) and (LC3=LC1) then
                                if (LC1=1) or (LC1=0) then KQ:='WIN';
                        end;
                end;
    if KQ<>'WIN' then KQ:='FALL';
    write(g,KQ); close(g); close(f);
end.

var a:array[1..5,1..5] of longint;
  k, x,y,i,j,m:longint;
    begin
     readln(m);
      for i:=1 to m do
       begin
         readln(x,y);
         a[x,y]:=a[y,x];
       end;
    m:=5;
      for i:=1 to m-2 do
       for j:=i+1 to m-1 do
        for k:=j+1 to m do
         if (a[i,j]=a[i,k]) and (a[i,k]=a[j,k]) then
          begin
           writeln('WIN');
           halt;
          end;
      writeln('FAIL');
   end.

var a:array[1..5,1..5] of integer;
q:array[1..5] of integer;
qb,qe,i,j,n,t,k:integer;

procedure init;
begin
qb:=1;
qe:=1;
end;

procedure push(i:integer);
begin
q[qe]:=i;
inc(qe);
end;

procedure clear;
begin
for k:=1 to (qe-1) do
        q[k]:=0;
end;

begin
readln(n);
for k:=1 to n do
begin
        readln(i,j);
        a[i,j]:=1;
        a[j,i]:=1;
end;
for i:=1 to 4 do
begin
        clear;
        init;
        push(i);
        for j:=i+1 to 5 do
                if (a[i,j]=1) then
                        push(j);
        while (qb<(qe-2)) do
        begin
                inc(qb);
                for j:=qb+1 to (qe-1) do
                        if (a[q[qb],q[j]]=1) then
                        begin
                                t:=1;
                                writeln('WIN');
                                break;
                        end;
        end;
        if (t=1) then
                break;
end;
if (t=0) then
begin
        for i:=1 to 4 do
        begin
                clear;
                init;
                push(i);
                for j:=i+1 to 5 do
                        if (a[i,j]=0) then
                                push(j);
                while (qb<(qe-2)) do
                begin
                        inc(qb);
                        for j:=qb+1 to (qe-1) do
                                if (a[q[qb],q[j]]=0) then
                                begin
                                        t:=1;
                                        writeln('WIN');
                                        break;
                                end;
                end;
                if (t=1) then
                        break;
        end;
end;
if (t=0) then
        writeln('FAIL');
end.

var
   ar : array[1..5,1..5] of boolean;
   ar2 : array[1..5] of longint;
   bol : boolean;
   k,i,j,l,a,b : byte;
begin
   readln(k);
   for i := 1 to k do
     begin
        readln(a,b);
        ar[a][b] := true;
        ar[b][a] := true;
     end;
   for i := 1 to 5 do
     begin
       for j := 1 to 5 do
         begin
            if ar[i][j] then inc(ar2[i]);
         end;
     end;
   bol := false;
   for i := 1 to 5 do
     begin
        if ar2[i] >=3 then bol := true;
     end;
   if bol then writeln('WIN')
   else writeln('FAIL');
end.

type matrica=array[1..5,1..5]of integer;
var a,b:matrica;
    n,i,j,u,v,m,ans,h,pr:integer;
    fix:array[1..5]of integer;

Procedure dfs(a:matrica;k,l:integer);
var i,pv:integer;
begin
fix[k]:=l;
for i:=1 to n do
 if(pr<>i)and(a[k,i]=1)then
  begin
   if(fix[i]=0)then dfs(a,i,fix[k]+1) else
   if(l-fix[i]=3)then begin
                       ans:=ans+1;
                       exit;
                      end;
  end;
end;
begin
n:=5;
readln(m);
for i:=1 to m do
 begin
  readln(u,v);
  a[u,v]:=1;
  a[v,u]:=1;
 end;
for i:=1 to n do
 for j:=1 to n do
  if(i<>j)then
   if(a[i,j]=0)then b[i,j]:=1;
for i:=1 to n do
 if(fix[i]=0)then dfs(b,i,1);
if ans=0 then begin
               for i:=1 to n do fix[i]:=0;
               for i:=1 to n do
                if(fix[i]=0)then dfs(a,i,1);
              end;
if(ans>0)then writeln('Win')
         else writeln('FAIL');
end.

type matrica=array[1..5,1..5]of integer;
var a,b:matrica;
    n,i,j,u,v,m,ans,h,pr:integer;
    fix:array[1..5]of integer;

Procedure dfs(a:matrica;k,l:integer);
var i,pv:integer;
begin
fix[k]:=l;
pv:=pr;
for i:=1 to n do
 if(pr<>i)and(a[k,i]=1)then
  begin
   if(fix[i]=0)then begin
                     pr:=k;
                     dfs(a,i,fix[k]+1);
                     pr:=pv;
                    end else
   if(l-fix[i]=3)then begin
                       ans:=ans+1;
                       exit;
                      end;
  end;
end;
begin
n:=5;
readln(m);
for i:=1 to m do
 begin
  readln(u,v);
  a[u,v]:=1;
  a[v,u]:=1;
 end;
for i:=1 to n do
 for j:=1 to n do
  if(i<>j)then
   if(a[i,j]=0)then b[i,j]:=1;
for i:=1 to n do
 if(fix[i]=0)then dfs(b,i,1);
if ans=0 then begin
               for i:=1 to n do fix[i]:=0;
               for i:=1 to n do
                if(fix[i]=0)then dfs(a,i,1);
              end;
if(ans>0)then writeln('WIN')
         else writeln('FAIL');
end.

type matrica=array[1..5,1..5]of integer;
var a,b:matrica;
    n,i,j,u,v,m,ans,h,pr:integer;
    fix:array[1..5]of integer;

Procedure dfs(a:matrica;k,l:integer);
var i,pv:integer;
begin
fix[k]:=l;
for i:=1 to n do
 if(pr<>i)and(a[k,i]=1)then
  begin
   if(fix[i]=0)then dfs(a,i,fix[k]+1) else
   if(l-fix[i]=3)then begin
                       ans:=ans+1;
                       exit;
                      end;
  end;
end;
begin
n:=5;
readln(m);
for i:=1 to m do
 begin
  readln(u,v);
  a[u,v]:=1;
  a[v,u]:=1;
 end;
for i:=1 to n do
 for j:=1 to n do
  if(i<>j)then
   if(a[i,j]=0)then b[i,j]:=1;
for i:=1 to n do
 if(fix[i]=0)then dfs(b,i,1);
if ans=0 then begin
               for i:=1 to n do fix[i]:=0;
               for i:=1 to n do
                if(fix[i]=0)then dfs(a,i,1);
              end;
if(ans>0)then writeln('WIN')
         else writeln('FAIL');
end.

type matrica=array[1..5,1..5]of integer;
var a,b:matrica;
    n,i,j,u,v,m,ans,h,pr:integer;
    fix:array[1..5]of integer;

Procedure dfs(a:matrica;k,l:integer);
var i,pv:integer;
begin
fix[k]:=l;
pv:=pr;
for i:=1 to n do
 if(pr<>i)and(a[k,i]=1)then
  begin
   if(fix[i]=0)then begin
                     pr:=k;
                     dfs(a,i,fix[k]+1);
                     pr:=pv;
                    end else
   if(l-fix[i]=2)then begin
                       ans:=ans+1;
                       exit;
                      end;
  end;
end;
begin
n:=5;
readln(m);
for i:=1 to m do
 begin
  readln(u,v);
  a[u,v]:=1;
  a[v,u]:=1;
 end;
for i:=1 to n do
 for j:=1 to n do
  if(i<>j)then
   if(a[i,j]=0)then b[i,j]:=1;
for i:=1 to n do
 if(fix[i]=0)then dfs(b,i,1);
if ans=0 then begin
               for i:=1 to n do fix[i]:=0;
               for i:=1 to n do
                if(fix[i]=0)then dfs(a,i,1);
              end;
if(ans>0)then writeln('WIN')
         else writeln('FAIL');
end.

Program z94b;
var
  a:array[1..5,1..5] of byte;
  n:integer;

Procedure in_data;
  var
    i,x,y:integer;
  begin
    readln(n);
    for i:=1 to n do
      begin
        readln(x,y);
        a[x,y]:=1;
        a[y,x]:=1;
      end;
  end;

function main(x:byte):byte;
  var
    i,j,l:integer;
  begin
    main:=0;
    for i:=1 to 5 do
      for j:=1 to 5 do
        if (a[i,j]=x) then
          for l:=1 to 5 do
            if (a[l,j]=x)and(a[l,i]=x) then
              begin
                main:=1;
                exit;
              end;
  end;

begin
  in_data;
  if (main(1)=0)and(main(0)=0) then
    write('FAIL')
                               else
    write('WIN');
end.

var
 k : array [0..11,0..11] of boolean;
 l,n,i,j,m,h,c,x,y,z : longint;
 s,p,ss,t : string;
begin
 readln(n);
 for i:=1 to n do
 begin
  readln(x,y);
  k[x,y]:=true;
 end;
 x:=0;
 z:=0;
 for i:=1 to 5 do for j:=i+1 to 5 do for l:=j+1 to 5 do
 begin
  if (k[i,j])and(k[j,l])and(k[i,l]) then inc(x);
  if (not k[i,j])and(not k[j,l])and(not k[i,l]) then inc(z);
 end;
 if (x=3)or(z=3) then writeln('WIN') else writeln('FAIL');
end.

Program z94b;
var a:array[1..5]of byte;
	n,x,y,i:byte;
begin
	read(n);
    for i:=1 to n do
    begin
    	read(x,y);
        inc(a[x]);
        inc(a[y]);
    end;
    for i:=1 to 5 do
    begin
    	if a[i]>2 then begin write('WIN');halt;end;
        if 4-a[i]>3 then begin write('WIN');halt;end;
    end;
    write('FAIL');
end.

var a:array [1..10,1..10] of longint;
i,j,z,x,y,m:longint;
begin
readln(m);
fillchar(a,sizeof(a),0);
for i:=1 to m do begin
 readln(x,y);
 a[x,y]:=1;
 a[y,x]:=1;
end;

for i:=1 to 5 do
 for j:=i+1 to 5 do
  for z:=z+1 to 5 do begin
   if (a[i,j]=1) and (a[i,z]=1) and (a[j,z]=1) then begin
    writeln('WIN');
    halt;
   end;
   if (a[i,j]=0) and (a[i,z]=0) and (a[j,z]=0) then begin
    writeln('WIN');
    halt;
   end;
  end;
writeln('FAIL');
end.

var a:array [1..10,1..10] of longint;
i,j,z,x,y,m:longint;
begin
readln(m);
fillchar(a,sizeof(a),0);
for i:=1 to m do begin
 readln(x,y);
 a[x,y]:=1;
 a[y,x]:=1;
end;

for i:=1 to 5 do
 for j:=i+1 to 5 do
  for z:=z+1 to 5 do begin
   if (a[i,j]=1) and (a[i,z]=1) and (a[j,z]=1) then begin
    writeln('WIN');
    halt;
   end;
   if (a[i,j]=0) and (a[i,z]=0) and (a[j,z]=0) then begin
    writeln('WIN');
    halt;
   end;
  end;
writeln('FALL');
end.

uses math;
Var m,i,u,v,s,n:integer;
    a:array [1..30,1..30] of integer;
    now:array [1..30] of integer;

Procedure dfs1(i,k:integer);
Var f:integer;
begin
         now[i]:=1;
       for f:=1 to n do
        if (a[i,f]=1) and (now[f]=0) then dfs1(f,k+1)
        else
        if (a[i,f]=1) and (now[f]=1) then
         if (k=2) and (f=s) then begin
          write('WIN');
          halt;
         end;

         now[i]:=2;
end;

Procedure dfs2(i,k:integer);
Var f:integer;
begin
         now[i]:=1;
       for f:=1 to n do
        if (a[i,f]=0) and (now[f]=0) then dfs2(f,k+1)
        else
        if (a[i,f]=0) and (now[f]=1) then
         if (k=2) and (f=s) then begin
          write('WIN');
          halt;
         end;

         now[i]:=2;
end;

begin
         read(m);
         n:=0;
       for i:=1 to m do begin
          read(u,v);
         a[u,v]:=1;
         a[v,u]:=1;
         n:=max(n,u);
         n:=max(n,v);
       end;

       for i:=1 to n do begin
         s:=i;
        for u:=1 to n do now[u]:=0;
         dfs1(i,0);
        for u:=1 to n do now[u]:=0;
         dfs2(i,0);

       end;
        write('FAIL');
end.

Var u,v:array [1..100] of integer;
    n,i,k,kol1,kol2:integer;
    use:array [1..100] of boolean;

Procedure dfs(i:integer);
Var j:integer;
begin
        use[i]:=true;
      for j:=1 to n do
       if (u[j]=i) and (not use[v[j]]) then dfs(v[j]);
end;

begin
         read(n);
       for i:=1 to n do
        read(u[i],v[i]);

       for i:=1 to n do begin
        for k:=1 to n do use[k]:=false;
          dfs(i);

           kol1:=0;
           kol2:=0;

        for k:=1 to n do
         if use[k] then inc(kol1)
         else inc(kol2);

        if (kol1=3) or (kol2=3) then begin
          write('WIN');
          halt;
        end
       end;
         write('FAIL');
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  g : array [1..5, 1..5] of boolean;
  a, b, i, j, k, m : integer;

begin
  REadln (m);
  for i := 1 to m do begin
    Readln (a, b);
    g [a, b] := True;
    g [b, a] := True;
  end;

  for i := 1 to 5 do
    for j := 1 to 5 do
      for k := 1 to 5 do
        if (g [i, j] and g [i, k] and g [j, k]) or ((not g [k, j]) and (not g [i, j]) and (not g [i, k])) and (i <> j) and (j <> k) and (i <> k) then begin
          Writeln ('WIN');
          Writeln (i, ' ', j, ' ', k);
          Readln;
          Halt;
        end;
  Writeln ('FAIL');
  Readln;
end.

var n,m,x,y:integer;
    c:array[1..5,1..5]of integer;
    i,j,k:integer;

begin
n:=5;
  readln(m);
  for i:=1 to m do begin
  readln(x,y);
  c[x,y]:=1;
  c[y,x]:=1;
  end;
  for i:=1 to n do
   for j:=1 to n do
    for k:=1 to n do
      begin
      m:=c[i,j]+c[i,k]+c[j,k];
      if ((m=0)or(m=3)) then begin writeln('WIN'); exit; end;
  end;
writeln('FAIL');

   readln;
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

const t:array[1..10,1..3] of integer=((1,2,3),(1,2,4),(1,2,5),(2,3,4),(2,3,5),(2,4,5),(3,4,5),(1,3,4),(1,3,5),(1,3,4));

var z,c,x,y,i,j,n,k,ans:integer;
a:Array [1..10,1..10] of boolean;
str,tmp:string;
w,e:boolean;
begin
readln(N);

for I := 1 to 6 do
for j := 1 to 6 do
a[i,j]:=false;

for I := 1 to n do
begin
read(x,y);
a[x,y]:=true;
a[y,x]:=true;
end;

w:=false;
e:=false;

for I := 1 to 10 do
begin
z:=t[i][1];
x:=t[i][2];
c:=t[i][3];

if (a[x,z] and a[x,c] and a[z,c]) then begin w:=true; writeln('WIN'); halt;end;

if ((not a[x,z]) and (not a[x,c]) and (not a[c,z])) then begin e:=true; writeln('WIN'); halt;end;

end;

//if (not e) and (not w) then writeln('WIN') else
writeln('FAIL');

//while True do

end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

const t:array[1..7,1..3] of integer=((1,2,3),(1,2,4),(1,2,5),(2,3,4),(2,3,5),(2,4,5),(3,4,5));

var z,c,x,y,i,j,n,k,ans:integer;
a:Array [1..10,1..10] of boolean;
str,tmp:string;
w,e:boolean;
begin
readln(N);

for I := 1 to 6 do
for j := 1 to 6 do
a[i,j]:=false;

for I := 1 to n do
begin
read(x,y);
a[x,y]:=true;
a[y,x]:=true;
end;

w:=false;
e:=false;

for I := 1 to 7 do
begin
z:=t[i][1];
x:=t[i][2];
c:=t[i][3];

if (a[x,z] and a[x,c] and a[z,c]) then begin w:=true; writeln('WIN'); halt;end;

if ((not a[x,z]) and (not a[x,c]) and (not a[c,z])) then begin e:=true; writeln('WIN'); halt;end;

end;

//if (not e) and (not w) then writeln('WIN') else
writeln('FAIL');

//while True do

end.

program Project2;
Var m:array [1..5,1..5] of integer;
j,i,n,a,b:integer;
begin
//  Assign(Input,'input.txt');
//  Assign(Output,'output.txt');
  Readln(n);
  for i:=1 to n do
  begin
    Readln(a,b);
    m[a,b]:=1;
    m[b,a]:=1;
  end;
  a:=0; b:=0;
  for i:=1 to 5 do
  for j:=i+1 to 5 do
  if (i<>j)and(m[i,j]=m[j,i])
  then begin
        if m[i,j]=1
        then Inc(a)
        else inc(b);
       end;
  if (a<3)and(b<3)
  then Writeln('FAIL')
  else writeln('WIN');
end.

program Project2;
Var m:array [1..5,1..5] of integer;
j,i,n,a,b:integer;
begin
//  Assign(Input,'input.txt');
//  Assign(Output,'output.txt');
  Readln(n);
  for i:=1 to n do
  begin
    Readln(a,b);
    m[a,b]:=1;
    m[b,a]:=1;
  end;
  a:=0; b:=0;
  for i:=1 to 3 do
  for j:=i+1 to 3 do
  if (i<>j)and(m[i,j]=m[j,i])
  then begin
        if m[i,j]=1
        then Inc(a)
        else inc(b);
       end;
  if (a=3)or(b=3)
  then Writeln('WIN')
  else writeln('FAIL');
end.

program Project2;
Var m:array [1..5,1..5] of integer;
j,i,n,a,b:integer;
begin
//  Assign(Input,'input.txt');
//  Assign(Output,'output.txt');
  Readln(n);
  for i:=1 to n do
  begin
    Readln(a,b);
    m[a,b]:=1;
    m[b,a]:=1;
  end;
  a:=0; b:=0;
  for i:=1 to n do
  for j:=i+1 to n do
  if (i<>j)and(m[i,j]=m[j,i])
  then begin
        if m[i,j]=1
        then Inc(a)
        else inc(b);
       end;
  if (a=3)and(b=3)
  then Writeln('WIN')
  else writeln('FAIL');
end.

program Project2;
Var i,a,b,j,i1,n:Integer;
m:array [1..5,1..5] of integer;
begin
//  Assign(input,'input.txt');
//  Assign(output,'output.txt');
  Readln(n);
  for i:=1 to n do
  begin
    Readln(a,b);
    m[a,b]:=1;
    m[b,a]:=1;
  end;
  for i:=1 to 5 do
  for j:=1 to 5 do
  if m[i,j]=1
  then begin
        for i1:=j+1 to n do
        if (m[j,i1]=1)and(m[i1,i]=1)
        then begin
              Writeln('WIN');
              Halt;
             end;
       end
  else begin
        for i1:=j+1 to n do
        if (m[j,i1]=0)and(m[i1,i]=0)
        then begin
              Writeln('WIN');
              Halt;
             end;
       end;
  Writeln('FAIL');
end.

program Project2;
Var i,a,b,j,i1,n:Integer;
m:array [1..5,1..5] of integer;
begin
//  Assign(input,'input.txt');
//  Assign(output,'output.txt');
  Readln(n);
  for i:=1 to n do
  begin
    Readln(a,b);
    m[a,b]:=1;
    m[b,a]:=1;
  end;
  for i:=1 to 5 do
  for j:=1 to i-1 do
  if m[i,j]=1
  then begin
        for i1:=1 to n do
        if (m[j,i1]=1)and(m[i1,i]=1)and(i1<>i)and(i1<>j)
        then begin
              Writeln('WIN');
              Halt;
             end;
       end
  else begin
        for i1:=1 to n do
        if (m[j,i1]=0)and(m[i1,i]=0)and(i1<>i)and(i1<>j)
        then begin
              Writeln('WIN');
              Halt;
             end;
       end;
  Writeln('FAIL');
end.

program ProjectB;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  n, i, j, k, x, y: Integer;
  a: array[1..5, 1..5] of Integer;
begin
  //reset(input, 'input.txt');
  //write(output, 'output.txt');
  Readln(n);
  for i := 1 to n do
  begin
    Readln(x, y);
    a[x, y] := 1;
    a[y, x] := 1;
  end;
  {if n < 5 then
  begin
    Writeln('WIN');
    Halt;
  end;}
  for i := 1 to 5 do
    for j := i + 1 to 5 do
      for k := j + 1 to 5 do
      begin
        if ((a[i, j] = 1)and(a[i, k] = 1)and(a[k, j] = 1))or((a[i, j] = 0)and(a[i, k] = 0)and(a[j, k] = 0)) then
        begin
          Writeln('WIN');
          Halt;
        end;
      end;
  Writeln('FALL');
  readln;
  //close(input);
  //close(output);
end.

program ProjectB;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  n, i, j, k, x, y: Integer;
  a: array[1..5, 1..5] of Integer;
begin
  //set(input, 'input.txt');
  //write(output, 'output.txt');
  Readln(n);
  for i := 1 to n do
  begin
    Readln(x, y);
    a[x, y] := 1;
    a[y, x] := 1;
  end;
  for i := 1 to 5 do
    for j := 1 to 5 do
      for k := 1 to 5 do
      begin
        if (i = j)or(j = k)or(k = i) then
        begin
        end
        else
        begin
          if ((a[i, j] = 1)and(a[i, k] = 1)and(a[k, j] = 1))or((a[i, j] = 0)and(a[i, k] = 0)and(a[j, k] = 0)) then
          begin
            Writeln('WIN');
            Halt;
          end;
        end;
      end;
  Writeln('FALL');
  //ose(input);
  //ose(output);
end.

program ProjectB;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  n, i, j, k, x, y: Integer;
  a: array[1..5, 1..5] of Integer;
begin
  //reset(input, 'input.txt');
  //Rewrite(output, 'output.txt');
  Readln(n);
  for i := 1 to n do
  begin
    Readln(x, y);
    a[x, y] := 1;
    a[y, x] := 1;
  end;
  for i := 1 to 5 do
    for j := 1 to 5 do
      for k := 1 to 5 do
      begin
        if (i = j)or(j = k)or(k = i) then
        begin
        end
        else
        begin
          if ((a[i, j] = 1)and(a[i, k] = 1)and(a[k, j] = 1))or((a[i, j] = 0)and(a[i, k] = 0)and(a[j, k] = 0)) then
          begin
            Writeln('WIN');
            Halt;
          end;
        end;
      end;
  Writeln('FALL');
  //close(input);
  //close(output);
end.

program ProjectB;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  n, i, j, k, x, y: Integer;
  a: array[1..5, 1..5] of Integer;
begin
  //reset(input, 'input.txt');
  //write(output, 'output.txt');
  Readln(n);
  for i := 1 to n do
  begin
    Readln(x, y);
    a[x, y] := 1;
    a[y, x] := 1;
  end;
  if n < 5 then
  begin
    Writeln('WIN');
    Halt;
  end;
  for i := 1 to 5 do
    for j := i + 1 to 5 do
      for k := j + 1 to 5 do
      begin
        if (i = j)or(j = k)or(k = i) then
        begin
        end
        else
        begin
          if ((a[i, j] = 1)and(a[i, k] = 1)and(a[k, j] = 1))or((a[i, j] = 0)and(a[i, k] = 0)and(a[j, k] = 0)) then
          begin
            Writeln('WIN');
            Halt;
          end;
        end;
      end;
  Writeln('FALL');
  readln;
  //close(input);
  //close(output);
end.

program pr1;

{$APPTYPE CONSOLE}

{type int64=longint; }
const nn=200000;
 eps=0.000000001;  nnn=200;
var t,i2,j2,kol,i,j,l,m,k,tt,imin,zap,f1,f2,i0,j0,h,t1:longint;
n,p,pp,s,izb:int64;
flag:boolean;
ott:double;
ss:string;
x,y,a,b:array[0..nn] of longint;
del:array[0..nn,0..300] of longint;
function min (a,b:longint):longint;begin min:=b;if a<b then min:=a;  end;
function max (a,b:longint):longint;begin max:=b;if a>b then max:=a;  end;

function nod(a,b:longint):longint; var p,t:longint;
begin if (a>0)and(b>0) then
   begin while (b>0) do begin t:=a mod b;a:=b;b:=t;    end;
    p:=a;
   end else if a=0 then p:=b else p:=a;
nod:=p;
end;

begin
{assign (input,'input.txt');reset(input);
      assign (output,'output1234.txt'); rewrite(output); }
readln(n);
for i:=1 to n do read(x[i],y[i]);
  for i:=1 to n do
begin
  p:=min(x[i],y[i]);k:=max(x[i],y[i]); inc(a[p]);inc(b[k]);
end;
flag:=true;
for i:=1 to 5 do if (a[i]<>1)or(b[i]<>1) then flag:=false;

  if flag then writeln('FAIL') else writeln('WIN');

      close(output);
end.

program pr1;

{$APPTYPE CONSOLE}

{type int64=longint; }
const nn=200000;
 eps=0.000000001;  nnn=200;
var t,i2,j2,kol,i,j,l,m,k,tt,imin,zap,f1,f2,i0,j0,h,t1:longint;
n,p,pp,s,izb:int64;
flag:boolean;
ott:double;
ss:string;
x,y,a,b:array[0..nn] of longint;
del:array[0..nn,0..300] of longint;
function min (a,b:longint):longint;begin min:=b;if a<b then min:=a;  end;

function nod(a,b:longint):longint; var p,t:longint;
begin if (a>0)and(b>0) then
   begin while (b>0) do begin t:=a mod b;a:=b;b:=t;    end;
    p:=a;
   end else if a=0 then p:=b else p:=a;
nod:=p;
end;

begin
{assign (input,'input.txt');reset(input);
      assign (output,'output1234.txt'); rewrite(output); }
readln(n);
for i:=1 to n do read(x[i],y[i]);
  for i:=1 to n do
begin
   inc(a[x[i]]);inc(b[x[i]]);
end;
flag:=true;
for i:=1 to 5 do if (a[i]<>1)or(b[i]<>1) then flag:=false;

  if flag then writeln('FAIL') else writeln('WIN');

      close(output);
end.

program codef_76_d2_B;
var
i,j,n,s:integer; a:array[1..10,1..2] of integer;
z:array[1..10,1..5] of integer;  f:boolean;
begin
{assign(input,'input.txt');
assign(output,'output.txt');
reset(input); rewrite(output);}
 readln(n); f:=false; s:=0;
for i:=1 to n do begin
 for j:=1 to 2 do read(a[i,j]);
 readln;
 end;
  for i:=1 to n do begin z[a[i,1],a[i,2]]:=1; z[a[i,2],a[i,1]]:=1; end;
    for i:=1 to 5 do
     begin
      for j:=1 to 5 do if z[i,j]=1 then inc(s);
      if (s=1) or (s=3) then f:=true;
      if f=true then begin write('WIN'); exit; end;
     s:=0;
     end;
     write('FAIL');
{close(input);
close(output);}
end.

program codef_76_d2_B;
var
i,j,n,s:integer; a:array[1..10,1..2] of integer;
z:array[1..10,1..5] of integer;  f:boolean;
begin
{assign(input,'input.txt');
assign(output,'output.txt');
reset(input); rewrite(output); }
 readln(n); f:=false;
for i:=1 to n do begin
 for j:=1 to 2 do read(a[i,j]);
 readln;
 end;
  for i:=1 to n do z[a[i,1],a[i,2]]:=1;
    for i:=1 to n do
     begin
      for j:=1 to 5 do if z[i,j]=1 then inc(s);
      if (s=1) or (s=3) then f:=true;
      if f=true then begin write('WIN'); exit; end;
     s:=0;
     end;
     write('FAIL');
{close(input);
close(output);}
end.

program codef_76_d2_B;
var
i,j,n,s:integer; a:array[1..10,1..2] of integer;
z:array[1..10,1..5] of integer;  f:boolean;
begin
{assign(input,'input.txt');
assign(output,'output.txt');
reset(input); rewrite(output); }
 readln(n); f:=false;
for i:=1 to n do begin
 for j:=1 to 2 do read(a[i,j]);
 readln;
 end;
  for i:=1 to n do z[a[i,1],a[i,2]]:=1;
    for i:=1 to n do
     begin
      for j:=1 to 5 do if z[i,j]=1 then inc(s);
      if (s=2) or (s=3) then f:=true;
      if f=true then begin write('WIN'); exit; end;
     s:=0;
     end;
     write('FAIL');
{close(input);
close(output);}
end.

program codef_76_d2_B;
var
i,j,n,s:integer; a:array[1..10,1..2] of integer;
z:array[1..10,1..5] of integer;  f:boolean;
begin
{assign(input,'input.txt');
assign(output,'output.txt');
reset(input); rewrite(output); }
 readln(n); f:=false;
for i:=1 to n do begin
 for j:=1 to 2 do read(a[i,j]);
 readln;
 end;
  for i:=1 to n do z[a[i,1],a[i,2]]:=1;
    for i:=1 to n do
     begin
      for j:=1 to 5 do if z[i,j]=1 then inc(s);
      if (s<=3) then f:=true;
      if f=true then begin write('WIN'); exit; end;
     s:=0;
     end;
     write('FAIL');
{close(input);
close(output);}
end.

program codef_76_d2_B;
var
i,j,n,s:integer; a:array[1..10,1..2] of integer;
z:array[1..10,1..5] of integer;  f:boolean;
begin
{assign(input,'input.txt');
assign(output,'output.txt');
reset(input); rewrite(output); }
 readln(n); f:=false;
for i:=1 to n do begin
 for j:=1 to 2 do read(a[i,j]);
 readln;
 end;
  for i:=1 to n do z[a[i,1],a[i,2]]:=1;
    for i:=1 to n do
     begin
      for j:=1 to 5 do if z[i,j]=1 then inc(s);
      if (s>=2) then f:=true;
      if f=true then begin write('WIN'); exit; end;
     s:=0;
     end;
     write('FAIL');
{close(input);
close(output);}
end.

program Project_druzya___;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
      a,b:array[1..5] of integer;
      i,n,sum,x,y:integer;
      fi,fo:text;
begin

readln(n);
for i:=1 to 5 do
    begin
    a[i]:=-1;
    b[i]:=-1;
    end;
for i:=1 to n do
    begin
    read(x,y);
    inc(a[x]);
    inc(b[y]);
    end;
sum:=0;
for i:=1 to 5 do
    begin
    if (a[i]=-1) then a[i]:=0;
    if (b[i]=-1) then b[i]:=0;
    end;
for i:=1 to 5 do
   begin
   sum:=sum+a[i]+b[i];
   end;
if (sum>=3) then write('WIN') else write( 'FALL');

end.

program Project_druzya___;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
      a,b:array[1..5] of integer;
      i,n,sum,x,y:integer;
      fi,fo:text;
begin

readln(n);
for i:=1 to 5 do
    begin
    a[i]:=-1;
    b[i]:=-1;
    end;
for i:=1 to n do
    begin
    read(x,y);
    inc(a[x]);
    inc(b[y]);
    end;
sum:=0;
for i:=1 to 5 do
    begin
    if (a[i]=-1) then a[i]:=0;
    if (b[i]=-1) then b[i]:=0;
    end;
for i:=1 to 5 do
   begin
   sum:=sum+a[i]+b[i];
   end;
if (sum>=3) then write('WIN') else write( 'FAIL');

read(n);
end.

{$APPTYPE CONSOLE}
const n=5;
var
a : array [1..n,1..n] of boolean;
z : array [1..n] of byte;
i,j,m,c,l,k : byte;
ok : boolean;
begin
{reset (input,'input.txt');
rewrite (output,'output.txt');}
readln (m);
fillchar (a,sizeof (a),false);
ok:=false;
for l:=1 to m do
begin
read (i,j);
a [i,j]:=true;
a [j,i]:=true;
end;
for i:=1 to n do
begin
c:=0;
k:=n;
fillchar (z,sizeof(z),0);
 for j:=1 to n do
 if a [i,j] then
 begin
 inc (c);
 z [c]:=j;
 end
 else
 if i<>j then
 begin
 z [k]:=j;
 dec (k);
 end;
if c=2 then
 if a [z [1],z [2]] or not a [z [4],z [5]] then
 begin
 write ('WIN');
 ok:=true;
 exit;
 end;
end;
 if not ok then write ('FAIL');
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;
 var i,j,n:Integer;
begin
 read(n);
  if n>8 then write('FAIL');
end.

var a:array[1..5]of byte;
        n,x,y,i:byte;
begin
        read(n);
    for i:=1 to n do
    begin
        read(x,y);
        inc(a[x]);
        inc(a[y]);
    end;
    for i:=1 to 5 do
    begin
        if a[i]>2 then begin write('WIN');halt;end;
    end;
    write('FAIL');
end.

Var x,y,i,n,j:LongInt;
    a:Array[1..1000,1..1000] of LongInt;
    a1,a2:Array[1..1000] of LongInt;
    y1:String;
  begin
    ReadLn(n);
    fillchar(a,sizeof(a),0);
    For i:=1 to n do
     begin
       Read(x,y);
       a[x,y]:=1;
       a[y,x]:=1;
     end;
    For i:=1 to 5 do
     For j:=1 to 5 do
      if (i<>j) and (a[i,j]=1) then begin a1[i]:=a1[i]+1; a1[j]:=a1[j]+1; end
      else if (I<>j) and (a[i,j]=0) then begin a2[i]:=a2[i]+1; a2[j]:=a2[j]+1; end;
    y1:='FAIL';
    For i:=1 to 5 do
     if (a1[i]=3) or (a2[i]=3) then begin y1:='WIN'; Break; end;
    WriteLn(y1);
  end.

Var x,y,i,n,j:LongInt;
    a:Array[1..1000,1..1000] of LongInt;
    a1,a2:Array[1..1000] of LongInt;
    y1:String;
  begin
    ReadLn(n);
    fillchar(a,sizeof(a),0);
    For i:=1 to n do
     begin
       Read(x,y);
       a[x,y]:=1;
     end;
    For i:=1 to 5 do
     For j:=1 to 5 do
      if (i<>j) and (a[i,j]=1) then begin a1[i]:=a1[i]+1; a1[j]:=a1[j]+1; end
      else if (I<>j) and (a[i,j]=0) then begin a2[i]:=a2[i]+1; a2[j]:=a2[j]+1; end;
    y1:='FAIL';
    For i:=1 to 5 do
     if (a1[i]=3) or (a2[i]=3) then begin y1:='WIN'; Break; end;
    WriteLn(y1);
  end.

Var x,y,i,n,j:LongInt;
    a:Array[1..1000,1..1000] of LongInt;
    a1,a2:Array[1..1000] of LongInt;
    y1:String;
  begin
    ReadLn(n);
    For i:=1 to n do
     begin
       Read(x,y);
       a[x,y]:=1;
     end;
    For i:=1 to 5 do
     For j:=1 to 5 do
      if (i<>j) and (a[i,j]=1) then begin a1[i]:=a1[i]+1; a1[j]:=a1[j]+1; end
      else if (I<>j) and (a[i,j]=0) then begin a2[i]:=a2[i]+1; a2[j]:=a2[j]+1; end;
    y1:='FAIL';
    For i:=1 to 5 do
     if (a1[i]=3) or (a2[i]=3) then begin y1:='WIN'; Break; end;
    WriteLn(y1);
  end.

Var x,y,i,n,j:LongInt;
    a:Array[1..1000,1..1000] of LongInt;
    a1,a2:Array[1..1000] of LongInt;
    y1:String;
  begin
    ReadLn(n);
    fillchar(a,sizeof(a),0);
    For i:=1 to n do
     begin
       Read(x,y);
       a[x,y]:=1;
     end;
    For i:=1 to 5 do
     For j:=1 to 5 do
      if (i<>j) and (a[i,j]=1) then begin a1[i]:=a1[i]+1; a1[j]:=a1[j]+1; end
      else if (I<>j) and (a[i,j]=0) then begin a2[i]:=a2[i]+1; a2[j]:=a2[j]+1; end;
    y1:='FAIL';
    For i:=1 to 5 do
     if (a1[i]>=3) or (a2[i]>=3) then begin y1:='WIN'; Break; end;
    WriteLn(y1);
  end.

Var x,y,i,n,j,u,u1:LongInt;
    a:Array[1..1000,1..1000] of LongInt;
    a1,a2:Array[1..1000] of LongInt;
    y1:String;
  begin
    ReadLn(n);
    fillchar(a,sizeof(a),0);
    For i:=1 to n do
     begin
       Read(x,y);
       a[x,y]:=1;
       A[y,x]:=1;
     end;
    y1:='FAIL';
    For i:=1 to 5 do
     begin
       u:=0;
       u1:=0;
     For j:=1 to 5 do
      if (i<>j) and (a[i,j]=1) then begin u:=u+1; end
      else if (i<>j) and (a[i,j]=0) then begin u1:=u1+1; end;
      if u>=3 then begin y1:='WIN'; Break; end;
      if (u=0) and (u1>=3) then begin y1:='WIN'; Break; end;
     end;
    WriteLn(y1);
  end.

Var x,y,i,n,j,u,u1:LongInt;
    a:Array[1..1000,1..1000] of LongInt;
    a1,a2:Array[1..1000] of LongInt;
    y1:String;
  begin
    ReadLn(n);
    fillchar(a,sizeof(a),0);
    For i:=1 to n do
     begin
       Read(x,y);
       a[x,y]:=1;
     end;
    y1:='FAIL';
    For i:=1 to 5 do
     begin
       u:=0;
       u1:=0;
     For j:=1 to 5 do
      if (i<>j) and (a[i,j]=1) then begin u:=u+1; end
      else if (i<>j) and (a[i,j]=0) then begin u1:=u1+1; end;
      if u>=3 then begin y1:='WIN'; Break; end;
      if (u=0) and (u1>=3) then begin y1:='WIN'; Break; end;
     end;
    WriteLn(y1);
  end.

Var x,y,i,n,j,u:LongInt;
    a:Array[1..1000,1..1000] of LongInt;
    a1,a2:Array[1..1000] of LongInt;
    y1:String;
  begin
    ReadLn(n);
    fillchar(a,sizeof(a),0);
    For i:=1 to n do
     begin
       Read(x,y);
       a[x,y]:=1;
     end;
    For i:=1 to 5 do
     For j:=1 to 5 do
      if (i<>j) and (a[i,j]=1) then begin a1[i]:=a1[i]+1; a1[j]:=a1[j]+1; end;
    y1:='FAIL';
    For i:=1 to 5 do
     if (a1[i]>=3) then begin y1:='WIN'; Break; end
     else if a1[i]=0 then u:=u+1;
    if u>=3 then y1:='WIN';
    WriteLn(y1);
  end.

const fi = '';
      fo = '';
var n, x, y, i, m: longint;
    a: array[1..6] of longint;
begin
  assign(input,fi); reset(input);
  assign(output,fo); rewrite(output);

  readln(n);
  for i:=1 to n do
    begin
      readln(x,y);
      inc(a[x]);
      inc(a[y]);
    end;
  if m > 5 then writeln('WIN')
  else
    begin
      for i:=1 to 5 do
        if a[i] > 2 then
          begin
            writeln('WIN');
            halt;
          end;
      writeln('FAIL');
    end;

  close(input); close(output);
end.

const fi = '';
      fo = '';
var n, x, y, i, m: longint;
    a: array[1..6] of longint;
begin
  assign(input,fi); reset(input);
  assign(output,fo); rewrite(output);

  readln(n);
  for i:=1 to n do
    begin
      readln(x,y);
      inc(a[x]);
      inc(a[y]);
    end;
  if m = 5 then writeln('WIN')
  else
    begin
      for i:=1 to 5 do
        if a[i] = 2 then
          begin
            writeln('WIN');
            halt;
          end;
      writeln('FAIL');
    end;

  close(input); close(output);
end.

const fi = '';
      fo = '';
var n, x, y, i, m: longint;
    a: array[1..6] of longint;
begin
  assign(input,fi); reset(input);
  assign(output,fo); rewrite(output);

  readln(n);
  for i:=1 to n do
    begin
      readln(x,y);
      inc(a[x]);
      inc(a[y]);
    end;
  if m < 5 then writeln('WIN')
  else
    begin
      for i:=1 to 5 do
        if a[i] >= 3 then
          begin
            writeln('WIN');
            halt;
          end;
      writeln('FAIL');
    end;

  close(input); close(output);
end.

program ll;
 var a,b,c,n,k,m,j,i,t:longint;q:array[0..10,0..10]of boolean;r:real;s:string;
 begin
{assign(input,'input.txt');reset(input);
assign(output,'output.txt');rewrite(output);}
read(n);

for i:=1 to n do

begin
 read(a,b);
 q[a,b]:=true;
 q[b,a]:=true;
end;
 for i:=1 to 3 do
 for j:=i+1 to 4 do
 for n:=j+1 to 5 do
 if (q[i,j]and q[i,n] and q[j,n])or (not q[i,j]and not q[i,n] and not q[j,n])
 then begin
 write('WIN');halt;
 end;
 write('FALL');

{close(input);close(output);}
end.

{ uses crt; }
   const nn=40; eps=0.0000001;  besk=20000;  nnn=20;
   label 1,2;
    type mas=array [0..nn,0..3] of longint;
    var p0,p,kk,n,i,j,k,l,t,jmax,m,s,sh,p1,p2,p3:longint; flag:boolean;
       y:mas;
       ss,sv:string;
       s1:array[0..10] of string;
       vse,a,b,c:array[0..nn,0..2] of longint;
       flag1,flag2,flag3:boolean;
      { a,b,ob:array[0..nn,0..2] of longint; }
       mmax: array[0..nn] of longint;
       ppp,xx,yy,ugol,vugol,x0,x1,y0,y1:real;
       obl:boolean; vv:array[0..nn] of real;
  function min(x,y:longint):longint; begin min:=x;if y<x then min:=y;end;
  function max(x,y:longint):longint; begin max:=x;if y>x then max:=y;end;
    function al(x,y:real):real; var t,p:real;
 begin
     if (x>0)and(y>=0) then p:=arctan(y/x);
     if x<0 then p:=pi+arctan(y/x);
     if(x>0)and(y<0) then p:=2*pi+arctan(y/x);
     if x=0 then if (y>=0) then p:=pi/2 else p:=3*pi/2;
     al:=p/pi*180;
 end;

function sovp(a:mas;p:longint):boolean; var i,j,k:longint;
begin         end;

     begin  {  clrscr;
     assign(input,'input.txt');        reset (input); }
    { assign(output,'output123.txt');   rewrite(output); }

        readln(n);
   for i:=1 to n do read(a[i,1],a[i,2]);

for i:=1 to 5 do for j:=i+1 to 5 do for k:=j+1 to 5 do
begin inc(t);b[t,0]:=i;b[t,1]:=j;b[t,2]:=k;end;
{for i:=1 to 10 do writeln(b[i,0],' ',b[i,1],' ',b[i,2],' ');}
t:=0;
for i:=1 to 5 do for j:=i+1 to 5 do begin inc(t); vse[t,1]:=i;vse[t,2]:=j;end;

{for i:=1 to 10 do writeln(vse[i,1],' ',vse[i,2]); writeln; }
t:=0;
for j:=1 to 10 do
  begin flag:=false;
        for i:=1 to n do
     if ((a[i,1]=vse[j,1])and(a[i,2]=vse[j,2]))or((a[i,1]=vse[j,2])and(a[i,2]=vse[j,1]))
     then begin  flag:=true; { writeln(t,' sovp ',i,' ',j);}  end;
        if  not flag then begin inc(t);c[t,1]:=vse[j,1]; c[t,2]:=vse[j,2];   end;

  end;

{for i:=1 to t do writeln(c[i,1],' ',c[i,2]); writeln; }
flag:=false;
for i:=1 to 10 do
  begin
     p1:=b[i,0];p2:=b[i,1];p3:=b[i,2];
     flag1:=false;flag2:=false;flag3:=false;
    for j:=1 to n do
    if ((a[j,1]=p1)and (a[j,2]=p2)) or ((a[j,1]=p2)and (a[j,2]=p1))  then flag1:=true;

    for j:=1 to n do
    if ((a[j,1]=p1)and (a[j,2]=p3)) or ((a[j,1]=p3)and(a[j,2]=p1))  then flag2:=true;

    for j:=1 to n do
    if ((a[j,1]=p2)and (a[j,2]=p3)) or ((a[j,1]=p3)and(a[j,2]=p2))  then flag3:=true;

 if flag1 and flag2 and flag3 then flag:=true;

  end;

 if flag then begin write('WIN');goto 1;   end;

flag:=false;
for i:=1 to 10 do
  begin
     p1:=b[i,0];p2:=b[i,1];p3:=b[i,2];
     flag1:=false;flag2:=false;flag3:=false;
    for j:=1 to t do
    if ((c[j,1]=p1)and (c[j,2]=p2)) or ((c[j,1]=p2)and (c[j,2]=p1))  then flag1:=true;

    for j:=1 to n do
    if ((c[j,1]=p1)and (c[j,2]=p3)) or ((c[j,1]=p3)and(c[j,2]=p1))  then flag2:=true;

    for j:=1 to n do
    if ((c[j,1]=p2)and (c[j,2]=p3)) or ((c[j,1]=p3)and(c[j,2]=p2))  then flag3:=true;

 if flag1 and flag2 and flag3 then flag:=true;

  end;

if flag then write('WIN') else write('FAIL');

1:

close(output);
           end.