int main() {
    int i,n,sayac=0,change[5]={100,20,10,5,1};
    scanf("%d",&n);
    for(i=0;i<5;i++) {
        sayac+=n/change[i];
        n=n%change[i];
    }
    printf("%d",sayac);
}

#include <stdio.h>
int main () {
    int n, k = 0;
    int bills[] = {100, 20, 10, 5, 1};

    scanf("%d", &n);

    while(n > 0) {
        for (int i = 0; i < 5; i++) {
            if (n >= bills[i]) {
                n -= bills[i];
                k++;
                break;
            }
        }
    }

    printf("%d", k);

}

#include <stdio.h>

int main()
{
    int n;
    int bills[5]={100,20,10,5,1};
    int min=0;
    scanf("%d",&n);
    for(int i = 0 ;i<5;i++)
    {
        while(n>=bills[i])
        {
            n-=bills[i];
            min++;
        }
    }
    printf("%d",min);

    return 0;
}

#include<stdio.h>

int main(){
	long long n;
	scanf("%lld",&n);
	long long x=n%100;
	long long y=x%20;
	long long z=y%10;
	long long t=z%5;
	printf("%lld",n/100+x/20+y/10+z/5+t);
	return 0;
}

#include <stdio.h>
#include <string.h>

// Recursive Solution
int Bills(int n, int arr[], int size) {
	if(n == 0) {
		return 0;
	}
	if(size == 1) {
		return n;
	}
	if(arr[size-1] > n) {
		return Bills(n,arr,size-1);
	}
	return n / (arr[size-1]) + Bills(n%(arr[size-1]), arr, size-1);
}

// DP Solution
int BillsDP(int n, int arr[], int size) {
	int dp[size+1][n+1];
	memset(dp,0,sizeof(dp));
	for(int i = 1; i<n+1;i++) {
		dp[1][i] = i;
	}
	for(int i = 2; i < size+1; i++) {
		for(int j = 1; j < n+1; j++) {
			if(arr[i-1] > j) dp[i][j] = dp[i-1][j];
			else {
				dp[i][j] = j/arr[i-1] + dp[i-1][j%arr[i-1]];
			}
		}
	}
	return dp[size][n];
}

// Greedy Solution
int BillsGreedy(int n, int arr[], int size) {
	int bills = 0;
	while(n > 0) {
		if(n >= arr[size-1]) {
			bills += n / arr[size-1];
			n %= arr[size-1];
		}
		size--;
	}
	return bills;
}

int main() {
	int n;
	scanf("%d", &n);
	int arr[] = {1,5,10,20,100};
	int size = sizeof(arr)/sizeof(arr[0]);
	int totalBills = BillsGreedy(n,arr,size);
	printf("%d\n", totalBills);
	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main (){
  int n, sum, count = 0, i;

  scanf("%d", &n);
  sum = n;
  for ( i = 0; i < n; i++ ){

    if (sum >= 100){
        sum = sum - 100;
        count++;
        if (sum == 0){

        printf("%d", count);
        break;
        }
        continue;
    }

    if (sum >= 20 && sum  < 100){
        sum = sum - 20;
        count++;
        if (sum == 0){

        printf("%d", count);
        break;
        }
        continue;
    }

    if (sum >= 10 && sum < 20){
        sum = sum - 10;
        count++;
        if (sum == 0){

        printf("%d", count);
        break;
        }
        continue;
    }

    if (sum >= 5 && sum < 10){
        sum = sum - 5;
        count++;
        if (sum == 0){

        printf("%d", count);
        break;
        }
        continue;
    }

    if (sum >= 1 && sum  < 5){
        sum = sum - 1;
        count++;
        if (sum == 0){
        printf("%d", count);
        break;
        }
        continue;
    }
  }

    return(0);
}

#include <stdio.h>

int main(void) {
  int n, digits = 0, quoitent = 0, choice;
  scanf("%d", &n);
  int temp = n;
  while(temp > 0){
    temp = temp / 10;
    digits++;
  }
  int count = 0;
  int remainder = n;
  while(remainder >= 5){
    quoitent = 0;
    remainder = 0;
    if(n >= 100){
      choice = 100;
    }else if(n >= 20){
      choice = 20;
    }else if(n >= 10){
      choice = 10;
    }else if(n >= 5){
      choice = 5;
    }else if(n >= 1){
      choice = 1;
    }
    quoitent = n / choice;
    remainder = n % choice;
    count += quoitent;
    if(remainder >= 5){
      n = remainder;
    }
  }
  if(remainder < 5 && remainder != 0){
    count += n % choice;
  }
  printf("%d", count);
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,count=0;
    scanf("%d",&n);
    while(n>=100){
        n=n-100;
        count++;
    }
    while(n>=20)
    {
        n=n-20;
        count++;
    }
    while(n>=10){
        n=n-10;
        count++;
    }
    while(n>=5){
        n=n-5;
        count++;
    }
    while(n>=1){
        n=n-1;
        count++;
    }
printf("%d",count);
    return 0;
}

#include <stdio.h>

int main(void) {
	int n;
	scanf("%d", &n);

	int i;
	int bills[] = { 100, 20, 10, 5, 1 };
	int bill;
	int ans = 0;
	for (i = 0; i < 5; ++i) {
		bill = bills[i];
		if (n < bill) {
			continue;
		}
		ans += n / bill;
		n = n % bill;
		if (n == 0) {
			break;
		}
	}

	printf("%d", ans);

	return 0;
}

#include <stdio.h>
#include <stdlib.h>

#pragma warning(disable: 4996)
int main()
{
	int x;
	int count = 0;

	scanf("%d", &x);

		if (x >= 100)
		{
			count = x / 100;
			x = x % 100;
		}
		if (x >= 20)
		{
			count+= (x / 20);
			x = x % 20;
		}
		if (x >= 10)
		{
			count+= (x / 10);
			x = x % 10;
		}
		if (x >= 5)
		{
			count+= (x / 5);
			x = x %5;
		}
		if (x >= 1)
		{

			count+= x;
			x = x % x;
		}
	printf("%d", count);
	return 0;
}

#include<stdio.h>

int main()
{
    long int x,y,count=0,z;
    scanf("%ld",&x);
    long int a[5]={1,5,10,20,100};
    for(y=4;y>=0;y--)
    {
        z=a[y];
        while(a[y]<=x)
        {
            a[y]=a[y]+z;
            count++;
        }
        x=x-(a[y]-z);
    }
    printf("%ld",count);
}

//Bismillah
#include<stdio.h>
int main()
{
    int n,i,j,k,r,s,l,m,o,p,q;
    scanf("%d",&n);
    i=n/100;
    j=n%100;
    if(j==0){
        printf("%d\n",i);
        return 0;
    }
    else{
        k=j/20;
        l=j%20;
    }
    if(l==0){
        printf("%d\n",i+k);
        return 0;
    }
    else{
        m=l/10;
        o=l%10;
    }

    if(o==0){
        printf("%d\n",i+k+m);
        return 0;
    }
    else{
        p=o/5;
        q=o%5;
    }
    if(q==0){
        printf("%d\n",i+k+m+p);
        return 0;
    }
    else{
        r=q/1;
        printf("%d\n",i+k+m+p+r);
        return 0;
    }
    return 0;

}

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int n;
    scanf("%d",&n);
    int C[5]={1,5,10,20,100};
    int i=4,sum=0;
    while(n%C[i]!=0)
    {
        sum=sum+n/C[i];

        n=n%C[i];
        i--;
    }
    printf("%d",sum+n/C[i]);
}

#include <stdio.h>
#include <stdlib.h>

#define NUMBILLS sizeof(bills)/sizeof(bills[0])

int main()
{
	int n;
	int bills[] = {1, 5, 10, 20, 100};
	int curr = NUMBILLS - 1;
	int cpt = 0;

	scanf("%d", &n);

	while (n > 0) {
		while (curr >= 0 && bills[curr] > n)
			--curr;
		cpt += n / bills[curr];
		n %= bills[curr];
	}
	printf("%d\n", cpt);
	return 0;
}

#include<stdio.h>
#include<string.h>
int main(){
int n;
scanf("%d",&n);
int count = 0;
while(n > 0) {
    if(n / 100 > 0) {
        count += n / 100;
        n = n % 100;
    }
    else if(n / 20 > 0) {
        count += n / 20;
        n = n % 20;
    }
    else if(n / 10 > 0) {
        count += n / 10;
        n = n % 10;
    }
    else if(n / 5 > 0) {
        count += n / 5;
        n = n % 5;
    }
    else  if(n / 1 > 0) {
        count += n / 1;
        n = n % 1;
    }
}
printf("%d",count);
 return 0;
}

#include <stdio.h>

typedef long long unsigned int llu;

int main() {
    llu n, m, count = 0, i;
    llu r[] = {100, 20, 10, 5, 1};

    scanf("%I64u", &n);
    m = n;

    for (i = 0; i < 5; i++) {
        if (m == 0) {
            break;
        }

        llu div = m / r[i];
        if (div >= 1) {
            m = m - div * r[i];
            count += div;
        }
    }

    printf("%I64u\n", count);

    return 0;
}

#include<stdio.h>
main()
{
 int checkn,checknn,a,b,c,hund=0,tw,ten=0,five=0,one=0;
 scanf("%d",&a);
 /****************/
 hund=a/100;
 /****************/
 checkn=(a%100)/10;
 if (checkn%2==0)
 {
     tw=checkn/2;
     ten=0;
 }
 else if (checkn%2!=0)
 {
     tw=(checkn-1)/2;
     ten=1;
 }
 /*****************/
 checknn=a%10;
 if (checknn%5==0)
    five=checknn/5;
 else if(checknn%5!=0)
 { if(checknn<5)
 {
     five=0;
    one=checknn;
 }
 else if(checknn>5)
 {
     five=1;
    one=checknn-5;
 }
 }
 /*****************/
 printf("%d",hund+tw+ten+five+one);
}

#include <stdio.h>

int main() {
    int n,den=0;
    scanf("%d",&n);

    den += (n/100);
    n = n%100;
    den += n/20;
    n = n%20;
    den += n/10;
    n = n%10;
    den += n/5;
    n = n%5;
    den += n;

    printf("%d\n",den);
    return 0;
}

#include <stdio.h>

int calDen(int n);

int main() {
    int n;
    scanf("%d",&n);

    printf("%d\n",calDen(n));

    return 0;
}

int calDen(int n) {
    if(n>99) {
        return n/100 + calDen(n%100);
    }
    else if(n > 19) {
        return n/20 + calDen(n%20);
    }
    else if(n > 9) {
        return n/10 + calDen(n%10);
    }
    else if(n > 4) {
        return n/5 + calDen(n%5);
    }
    else {
        return n;
    }
}

#include <stdio.h>

int main() {
    int D[] = {100,20,10,5,1};

    int n,den=0;
    scanf("%d",&n);

    for(int i=0;i<5;i++) {
        den += n/D[i];
        n = n%D[i];
    }

    printf("%d\n",den);
    return 0;
}

#include<stdio.h>
long long n,count=0,d;
main(void)
{
    scanf("%lld",&n);
    while(n>=100)
    {
        count+=(n/100);
        n=n%100;
    }
    while(n>=20)
    {
        count+=n/20;
        n=n%20;
    }
    while(n>=10)
    {
        count+=n/10;
        n=n%10;
    }
    while(n>=5)
    {
        count+=n/5;
        n=n%5;
    }
    count+=n;
    printf("%lld",count);
}

#include<stdio.h>
int main() {
    int n;
    scanf("%d",&n);
    int count=0;
    while(n > 0) {
        if(n >=100) {
            count=count+(n/100);
            n=n%100;
        }
        if(n >= 20) {
            count=count+(n/20);
            n=n%20;
        }
        if(n >= 10) {
            count=count+(n/10);
            n=n%10;
        }
         if(n >= 5) {
            count=count+(n/5);
            n=n%5;
        }
         if(n >= 1) {
            count=count+(n/1);
            n=n%1;
        }
    }
    printf("%d",count);
}

#include<stdio.h>
int main()
{
    int n;
    scanf("%d",&n);
    int count=n/100;
    n=n%100;
    count+=n/20;
    n=n%20;
    count+=n/10;
    n=n%10;
    count+=n/5;
    n=n%5;
    count+=n;
    printf("%d",count);
}

#include<stdio.h>
int main(void)
{
    unsigned long n,a,b,c,d,e,f,g,h;
    scanf("%lu",&n);
    a=n/100;
    b=n%100;
    c=b/20;
    d=b%20;
    e=d/10;
    f=d%10;
    g=f/5;
    h=f%5;
    printf("%lu",a+c+e+g+h);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n; //amount of money
    int bill[5]= {100,20,10,5,1}; //dollar bills
    int minbill=0; // minimum number of bills

    scanf("%d", &n);

    for(int i=0; i<5; i++)
    {
        while(n>=bill[i])
        {
            n=n-bill[i];
            minbill++;
        }

    }
    printf("%d", minbill);
    return 0;
}

  #include<stdio.h>
int main ()
{
    int n,sum=0;
    int i,arr[5]={100,20,10,5,1};
    scanf("%d",&n);
    for(i=0; i<5; i++)
    {
        sum+=n/arr[i];
        n=n%arr[i];
    }
    printf("%d",sum);
    return 0;
}

#include<stdio.h>
int main()
{
    int ar[5],a,i,remainder,dividend=0,result=0;
    scanf("%d",&a);
    ar[0]=1,ar[1]=5,ar[2]=10,ar[3]=20,ar[4]=100;
    for(i=4;i>=0;i--)
    {
        remainder=a%ar[i];
        dividend=a/ar[i];
        a=remainder;
        result=dividend+result;
        if(remainder==0)
            break;
    }
    printf("%d\n",result);
    return 0;
}

#include <stdio.h>

int main()
{
    long long int n,c=0;
    int a[5]={1,5,10,20,100};
    scanf("%lld",&n);
    int i=4;
    while(n>0&&i>=0)
    {
        c+=n/a[i];
        n=n%a[i];
        i--;
    }
    printf("%d\n",c);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n;
    scanf("%d", &n);
    int count = 0;
    while ( n > 0 )
    {
        if ( ( n - 100 ) >= 0 )
        {
            //printf("Subtracting 100 from %d\n", n);
            n -= 100;
            //printf("Result = %d\n", n);
            count++;
            continue;
        }
        else if ( ( n - 20 ) >= 0 )
        {
            //printf("Subtracting 20 from %d\n", n);
            n -= 20;
            //printf("Result = %d\n", n);
            count++;
            continue;
        }
        else if ( ( n - 10 ) >= 0 )
        {
            //printf("Subtracting 10 from %d\n", n);
            n -= 10;
            //printf("Result = %d\n", n);
            count++;
            continue;
        }
        else if ( ( n - 5 ) >= 0 )
        {
            //printf("Subtracting 5 from %d\n", n);
            n -= 5;
            //printf("Result = %d\n", n);
            count++;
            continue;
        }
        else if ( ( n - 1 ) >= 0 )
        {
            //printf("Subtracting 1 from %d\n", n);
            n -= 1;
            //printf("Result = %d\n", n);
            count++;
            continue;
        }
    }
    printf("%d", count);
}

#include<stdio.h>
int main()
{
    long int n;scanf("%ld",&n);
    long int rem=-1;long int count=0,nw;
    while(rem!=0)
    {
        if(n>=100)
        {
            rem=n%100;
            count=count+n/100;
            n=rem;
        }
        else if(n>=20 && n<100)
        {
            rem=n%20;
            count=count+n/20;
            n=rem;
        }
        else if(n>=10 && n<20)
        {
            rem=n%10;
            count=count+(n/10);
            n=rem;
        }
        else if(n>=5 && n<10)
        {
            rem=n%5;
            count=count+n/5;
            n=rem;
        }
        else
        {
            rem=n%1;
            count=count+(n/1);
            n=rem;
        }
    }
    printf("%ld",count);
    return 0;
}

#include <stdio.h>
#include <math.h>

int main()
{
    int i, x[]={100,20,10,5,1}, sum=0;
    long long int n, a;

    scanf("%lld", &n);

    for(i=0; i<=4; i++)
    {
        a=n/x[i];
        sum+=a;
        n=n%x[i];
    }
    printf("%d\n", sum);

    return 0;

}

#include<stdio.h>
#include<stdlib.h>
int cmp(const void* a,const void* b)
{
    return *((int*)b)-*((int*)a);
}
int main()
{
    int val;
    scanf("%d",&val);
    int a[5];
    a[0]=1;
    a[1]=5;
    a[2]=10;
    a[3]=20;
    a[4]=100;
    int i=4,c=0;
    while(i>=0)
    {
        if(val>0&&a[i]<=val)
        {
        c+=val/a[i];
        val=val%a[i];
        }
        if(a[i]>val)
        i--;
        if(val<=0)
        break;
    }
    printf("%d",c);

}

#include <stdio.h>
#include <time.h>

unsigned long long int lottery(unsigned long long int x)
{
	unsigned long long int sum = 0;

	sum += (x/100);

	x %= 100;

	sum += (x/20);

	x %= 20;

	sum += (x/10);

	x %= 10;

	sum += (x/5);

	x %= 5;

	sum += (x/1);

	x %= 1;

	return sum;

}

int main(void)
{
	double elapsed = 0;

	clock_t begin = clock();

	unsigned char c = 0;

	unsigned long long int x = 0;

	unsigned long long int i = 0;

	while 	(
			( i < 20 )

			&&

			(
				(c = fgetc(stdin) ) != EOF
			)

			&&

			( c >= '0')

			&&

			(c <= '9')
		)
	{
		x *= 10;

		x += (c-'0');

		i++;
	}

	printf("%llu\n",lottery(x));

	clock_t end = clock();

	fprintf(stderr,"Time elapsed: %.6f\n",(end-begin) / ((double)(CLOCKS_PER_SEC)));

	return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

unsigned long long int lottery(unsigned long long int x)
{
	unsigned long long int sum = 0;

	sum += (x/100);

	x %= 100;

	sum += (x/20);

	x %= 20;

	sum += (x/10);

	x %= 10;

	sum += (x/5);

	x %= 5;

	sum += (x/1);

	x %= 1;

	return sum;

}

int main(void)
{
	double elapsed = 0;

	clock_t begin = clock();

	unsigned char c = 0;

	unsigned long long int x = 0;

	unsigned long long int prev = 0;

	unsigned long long int i = 0;

	while 	(

			(
				(c = fgetc(stdin) ) != EOF
			)

			&&

			( c >= '0')

			&&

			(c <= '9')
		)
	{
		prev = x;

		x *= 10;

		x += (c-'0');

		if ( x < prev )
		{
			fprintf(stderr,"Error: Integer Overflow Vulnerability detected\n");

			exit(1);
		}

		i++;
	}

	if ( (c != 0xff) && (c != 0xa) )
	{
		fprintf(stderr,"Error: Improper formatting of standard input detected\n");

		exit(1);
	}

	printf("%llu\n",lottery(x));

	clock_t end = clock();

	fprintf(stderr,"Time elapsed: %.6f\n",(double)(end-begin) / ((double)(CLOCKS_PER_SEC)));

	return 0;
}

#include<stdio.h>

int main()
{
    int a , count=0;

    scanf("%d",&a);
    count=count+a/100;
    a=a%100;

    count=count+a/20;
    a=a%20;
    count=count+a/10;
    a=a%10;
    count=count+a/5;
    a=a%5;

    count=count+a;
    printf("%d\n",count);

    return 0;

}

#include<stdio.h>
int main()
{
	int bill;
	int bills, quot, rem;
	bills=0;

	scanf("%d", &bill);

	quot=bill/100;
	bills+=quot;

	rem=bill%100;
	bill=rem;

	quot=bill/20;
	bills+=quot;

	rem=bill%20;
	bill=rem;

	quot=bill/10;
	bills+=quot;

	rem=bill%10;
	bill=rem;

    quot=bill/5;
	bills+=quot;

	rem=bill%5;
	bill=rem;

	bills+=rem;
    printf("%d\n",bills);
    return 0;
}

#include <stdio.h>

int coins[] = {1, 5, 10, 20, 100}, x;

int f() {
	int i = 4;
	while(1) {
		if(x >= coins[i]) break;
		i--;
	}
//	puts("");
	return coins[i];
}

int main() {
//    freopen("input.in", "r", stdin);
	int res = 0;
//	return 322;
	scanf("%d", &x);

	while(x > 0) {
//		printf("%d\n", f(x));
		x -= f();
//		printf("%d\n", x);
		res++;
	}
	printf("%d", res);
	return 0;
}

#include<stdio.h>
#include<string.h>

int main()
{
int n,i;
scanf("%d",&n);
//printf("%d\n",n);
int c = 0;

c = c+n/100;
n = n%100;

c = c+n/20;
n = n%20;

c = c+n/10;
n = n%10;

c = c+n/5;
n = n%5;

c = c+n/1;
n = n%1;

printf("%d\n",c);
return 0;
}

#include<stdio.h>
int main()
{
    long int n,count = 0;
    scanf("%ld",&n);
    while(n)
    {
        if(n >= 100)
        {
            n = n - 100;
            count++;
        }
        else if(n >= 20)
        {
            n = n - 20;
            count++;
        }
        else if(n >= 10)
        {
            n = n - 10;
            count++;
        }
        else if(n >= 5)
        {
            n -= 5;
            count++;
        }
        else if(n >= 1)
        {
            n -= 1;
            count++;
        }
    }
    printf("%ld\n",count);
    return 0;
}

#include <stdio.h>
#include <string.h>

int main() {

	int dinheiro, notas = 0;
	scanf("%d", &dinheiro);

	while(dinheiro>0){

		if (dinheiro >= 100){
			dinheiro = dinheiro - 100;
			notas++;
		}
		else if (dinheiro < 100 && dinheiro >= 20){
			dinheiro = dinheiro - 20;
			notas++;
		}
		else if (dinheiro < 20 && dinheiro >= 10){
			dinheiro = dinheiro - 10;
			notas++;
		}
		else if (dinheiro < 10 && dinheiro >= 5){
			dinheiro = dinheiro - 5;
			notas++;
		}
		else if(dinheiro < 5){
			dinheiro = dinheiro - 1;
			notas++;
		}
	}

	printf("%d\n", notas);

	return 0;

}

#include<stdio.h>
int main()
{
    int m,n;
    int number=0;
    scanf("%d",&m);
    if(m>=100)
    {
        n=m/100;
        number=number+n;
        m-=n*100;
    }
    if(m>=20)
    {
        int n=m/20;
        number=number+n;
        m=m-n*20;

    }
    if(m>=10)
    {
        int n=m/10;
        number=number+n;
        m=m-n*10;
    }
    if(m>=5)
    {
        int n=m/5;
        number=number+n;
        m=m-n*5;
    }
    number=number+m;
    printf("%d\n",number);
    return 0;
}

#include <stdio.h>

int main()
{
	int inVar, count = 0;
	scanf("%d", &inVar);

	while (inVar >= 100) {

		inVar -= 100;
		count++;
	}

	while (inVar >= 20) {

		inVar -= 20;
		count++;
	}

	while (inVar >= 10) {

		inVar -= 10;
		count++;
	}

	while (inVar >= 5) {

		inVar -= 5;
		count++;
		}

	while (inVar >= 1) {

		inVar -= 1;
		count++;
	}
	printf("%d", count);

}

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int n,i,count;
    scanf("%d", &n);

    count=0;

    for(i=0;i<100;i++)
    {
        if(n>=100)
        {
            n=n-100;
            count++;
        }
        else if(n>=20)
        {
            n=n-20;
            count++;
        }
        else if(n>=10)
        {
            n=n-10;
            count++;
        }
        else if(n>=5)
        {
            n=n-5;
            count++;
        }
        else if(n>=1)
        {
            n=n-1;
            count++;
        }
        else if(n==0)
        {
            break;
        }
    }
    printf("%d", count);
}

#include <stdio.h>

int withdraw(int n){
    int res = 0;
    while(n > 0){
        if (n-100 >= 0){
            n = n-100;
            res++;
        } else if (n-20 >= 0){
            n = n - 20;
            res++;
        } else if (n - 10 >= 0){
            n = n - 10;
            res++;
        } else if (n - 5 >= 0){
            n = n - 5;
            res++;
        } else if (n - 1 >= 0){
            n = n -1;
            res++;
        }

    }
    printf("n = %d\n",n);
    return res;
}

int main(){
    printf("%d\n",withdraw(125));
    printf("%d\n",withdraw(43));
}

#include <stdio.h>
int main()
{
    int n;
    int bills[5]={100,50,20,10,1};
    int min=0;
    scanf("%d",&n);
    for(int i = 0 ;i<5;i++)
    {
        while(n>=bills[i])
        {
            n-=bills[i];
            min++;
        }
    }
    printf("%d",min);

    return 0;
}

#include<stdio.h>
int main(void)
{
    unsigned long n,a,b,c,d,e,f;
    scanf("%lu",&n);
    a=n/100;
    b=n%100;
    c=b/20;
    d=b%20;
    e=d/5;
    f=d%5;
    printf("%d",a+c+e+f);
    return 0;
}

#include <stdio.h>

int main(void) {
    long long int n,b,h;
    scanf("%d",&n);
    int i=0,a,c,d,e,f,g;
    b=n/100;
	a=n%100;
	c=a/20;
	d=a%20;
	e=d/10;
	f=d%10;
	g=f/5;
	h=b+c+e+g;
	printf("%d",h);
	return 0;
}

#include <stdio.h>

int main(void) {
    long long int n,b;
    scanf("%d",&n);
    int i=0,a,c,d,e,f,g,h;
    b=n/100;
	a=n%100;
	c=a/20;
	d=a%20;
	e=d/10;
	f=d%10;
	g=f/5;
	h=b+c+e+g;
	printf("%d",h);
	return 0;
}

int main() {
    int i,n,sayac=0,rem,change[5]={100,20,10,5,1};
    scanf("%d",&n);
    for(i=0;i<5;i++) {
        rem=n%change[i];
        n/=change[i];
        sayac+=n;
    }
    printf("%d",sayac);
}

#include<stdio.h>
int main(int argc, char const *argv[])
{
	int n,a;
	scanf("%d",&n);
	while (n>=100)
		{
			n=n-100;
			a++;
		}
		while (n>=20)
		{
			n=n-20;
			a++;
		}
		while (n>=10)
		{
			n=n-10;
			a++;
		}
		while (n>=5)
		{
			n=n-5;
			a++;
		}
		while(n>0){
			n=n-1;
			a++;
		}

	printf("%d",a );
	return 0;
}

#include <stdio.h>

int main(void) {
	int n;
	scanf("%d", &n);

	int i;
	int bills[] = { 100, 20, 10, 5, 1 };
	int bill;
	int ans;
	for (i = 0; i < 5; ++i) {
		bill = bills[i];
		if (n < bill) {
			continue;
		}
		ans += n / bill;
		n = n % bill;
		if (n == 0) {
			break;
		}
	}

	printf("%d", ans);

	return 0;
}

#include<stdio.h>

int main()
{
    long long int a , count=0;

    scanf("%d",&a);
    count=count+a/100;
    a=a%100;

    count=count+a/20;
    a=a%20;
    count=count+a/10;
    a=a%10;
    count=count+a/5;
    a=a%5;

    count=count+a;
    printf("%d\n",count);

    return 0;

}

#include <stdio.h>

int main() {
	int n;
	scanf("%d",&n);
	printf("%d",n/100+n/20+n/5+n/10+n/1);
	return 0;
}

#include<stdio.h>
int main()
{
 int n,a,b,count=0;
scanf("%d",&n);
while(n!=0)
{
 if(n>=100)
 {
   n=n-100;
   count++;

 }
 else if(n>=50)
 {
   n=n-50;
   count++;

 }
else if(n>=20)
 {
   n=n-20;
   count++;

 }
  else if(n>=10)
 {
   n=n-100;
   count++;

 }
 else if(n>=5)
 {
   n=n-5;
   count++;

 }
else if(n>=1)
 {
   n=n-1;
   count++;

 }

}
printf("%d\n",count);
return 0;
}

#include<stdio.h>
int main(void)
{
    unsigned long  n,a,b,c,d,e,f;
    scanf("%lu",&n);
    a=n/100;
    b=n%100;
    c=b/20;
    d=b%20;
    e=d/5;
    f=d%5;
    printf("%lu",a+c+e+f);
    return 0;
}

#include<stdio.h>
int main()
{
    int ar[5],a,i,remainder,dividend=0,result=0;
    scanf("%d",&a);
    ar[0]=1,ar[1]=5,ar[2]=10,ar[3]=20,ar[4]=100;
    for(i=4;i>0;i--)
    {
        if(a<5)
        {
            result=result+a;
            break;
        }
        remainder=a%ar[i];
        dividend=a/ar[i];
        a=remainder;
        result=dividend+result;
        if(remainder==0)
            break;
    }
    printf("%d\n",result);
    return 0;
}

#include<stdio.h>
int main(void)
{
    unsigned long long int n,a,b,c,d,e,f;
    scanf("%llu",&n);
    a=n/100;
    b=n%100;
    c=b/20;
    d=b%20;
    e=d/5;
    f=d%5;
    printf("%llu",a+c+e+f);
    return 0;
}

#include <stdio.h>

int main(){

	int cash, bills;

	scanf("%d", &cash);

	while(cash != 0){
		if(cash >= 100){
			cash = cash - 100;
			bills++;
		}
		else if(cash >= 20 && cash < 100){
			cash =  cash - 20;
			bills++;
		}
		else if(cash >= 10 && cash < 20){
			cash = cash - 10;
			bills++;
		}
		else if(cash >= 5 && cash < 10){
			cash = cash - 5;
			bills++;
		}
		else if(cash >= 1 && cash < 5){
			cash = cash - 1;
			bills++;
		}
	}

	printf("%d\n", bills);

	return 0;
}

#include <stdio.h>
typedef long long unsigned int ULL;
int main()
{
    ULL money, leftover, bills = 0LLU;
    scanf("%d", &money);

    //for 100
    leftover = money % 100LLU;
    bills += (money / 100LLU);
    money = leftover;

    //for 20
    leftover = money % 20LLU;
    bills += (money / 20LLU);
    money = leftover;

    //for 5
    leftover = money % 5LLU;
    bills += (money / 5LLU);
    money = leftover;

    //for 1
    bills += money;

    printf("%llu", bills);

    return 0;
}

#include<stdio.h>
#include<stdlib.h>
int main(){
    long long int n,sum=0;
    scanf("%ld",&n);
    sum=sum+n/100;
    if(n%100!=0){
        n=n%100;
        sum=sum+n/20;
        if(n%20!=0){
            n=n%20;
            sum=sum+n/10;
            if(n%10!=0){
            	n=n%10;
            sum=sum+n/5;
            if(n%5!=0){
                n=n%5;
                sum=sum+n/1;
            }
            }
        }
    }
    printf("%ld\n",sum);
}

 #include<stdio.h>
int main ()
{
    int n,sum=0;
    int i,arr[6]={100,50,20,10,5,1};
    scanf("%d",&n);
    for(i=0; i<6; i++)
    {
        sum+=n/arr[i];
        n=n%arr[i];
    }
    printf("%d",sum);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,r;
    r=n/100;
    n=n%100;
    r=r+n/20;
    n=n%20;
    r=r+n/5;
    n=n%5;
    r=r+n;

  return 0;
}

#include<stdio.h>

int main(){
    int n;
    int count = 0;
    scanf("%d", &n);
    while(n == 0){
        if(n >= 100){
            count++;
            n -= 100;
        }
        else if(n >= 20){
            count++;
            n -= 20;
        }
        else if(n >= 10){
            count++;
            n -= 10;
        }
         else if(n >= 5){
            count++;
            n -= 5;
        }
        else{
            count += n;
            n = 0;
        }
    }
    printf("%d", count);
}

#include<stdio.h>
int main(){
    long long int n,y=0;
    scanf("%lld",&n);
    int a[5]={100,20,10,5,1},i=0;
    while(n){
        if(n%a[i]==0){
            y++;
            printf("%lld",y);
            break;
        }
        else if(n/a[i]!=0){
            n=n%a[i];
            y++;
        }
        i++;
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int n,count=0;
    scanf("%d",&n);
    while(n>0){
    if(n>=100)
    {
        count=n/100;
        n=n-count*100;
    }
    else if(n>=20)
    {
        count=n/20;
        n=n-count*20;
    }
    else if(n>=20){
        count=n/10;
        n=n-count*10;
    }
    else if(n>=5)
    {
        count=n/5;
        n=n-count*5;
    }
    else
    {
        count=n;
        n=n-count;
    }
}
printf("%d",count);
}

#include<stdio.h>
int main()
{
    int n;
    scanf("%d",&n);
    int count=n/100;
    n=n%100;
    count+=n/20;
    n=n%20;
    count+=n/10;
    n=n%10;
    count+=n/5;
    n=n%5;
    count+=n;
    printf("%d",&count);
}

#include<stdio.h>
int main(){
    long long int n,y=0;
    scanf("%lld",&n);
    int a[5]={100,20,10,5,1},i=0;
    while(n){
        if(n%a[i]==0){
            y++;
            printf("%lld",y);
            break;
        }
        else{
            n=n%a[i];
            y++;
        }
        i++;
    }
    return 0;
}

#include <stdio.h>

int main()
{
    int n;
    int i100,i20,i10,i5,i1;

    /* Initialize all notes to 0 */
     i100  = i20 = i10 = i5 = i1 = 0;
    //int  count=0;

    /* Input amount from user */

    scanf("%d", &n);

    if(n >= i100)
    {
        i100 = n/100;
        n -= i100 * 100;
    }

    if(n >= 20)
    {
        i20 = n/20;
       n -= i20 * 20;
    }
    if(n >= 10)
    {
       i10 = n/10;
       n -= i10 * 10;
    }
    if(n >= 5)
    {
        i5 = n/5;
        n -= i5 * 5;
    }

    if(n >= 1)
    {
       i1 = n;
    }
    int count=i1=i5+i10+i20+i100;

    /* Print required notes */
    //printf("Total number of notes = \n");
  // printf("%d",&count);
  printf("%d",count);

    return 0;
}

#include<stdio.h>

int main(){
	long long int T;
	int count = 0;
	scanf("%lld",&T);
	while(T >= 100){
		T-=100;
		count++;
	}
	while(T >= 20){
		T-=20;
		count++;
	}

	while(T >= 5){
		T-=5;
		count++;
	}
	while(T >= 1){
		T-=1;
		count++;
	}
	printf("%d\n",count);
	return 0;
}

#include<stdio.h>
int main ()
{
    long long int n,a,c=0,i;
     int ar[6]={100,50,20,10,5,1};
     scanf("%lld", &n);
     for(i=0;i<=5;i++)
     {
         a=n/ar[i] ;
         c=c+a;
         n=n%ar[i] ;
     }
     {
         printf("%lld",c);
     }
     return 0;
}

int main() {
    int i,n,sayac=0,rem,change[5]={100,20,10,5,1};
    scanf("%d",&n);
    for(i=0;i<5;i++) {
        rem=n%change[i];
        n/=change[i];
        sayac+=n;
    }
    printf("%d",sayac);
}

#include<stdio.h>
int main()
{
	int num;
	printf("enter the number");
	scanf("%d",&num);
	int a[5]={1,5,10,20,100};
	int i=4,bills=0;
	while(num>0)
	{
		if(num>a[i])
		{
			bills+=num/a[i];
			num=num%a[i];
		}
		i--;

	}
	printf("number of bills are %d",bills);
}

#include<stdio.h>
int main()
{
    long int i,a,b,c=0,ar[]={100,20,10,5,1};
    scanf("%ld",&a);
    for(i=0;i<5;i++){
        if(a>=ar[i]) b=a/ar[i];
        if(a-b*ar[i]<0) continue;
        a=a-b*ar[i];
        c+=b;
        if(a==0) break;
    }
    printf("%ld\n",c);
    return 0;
}

#include<stdio.h>
int n1(int);
int n5(int);
int n10(int);
int n20(int);
int n100(int);
int main()
{
    int n,k,t;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d",&n);
        if(n<5)
        k=n1(n);
        else if(n>=5&&n<10)
        k=n5(n);
        else if(n>=10&&n<20)
        k=n10(n);
        else if(n>=20&&n<=100)
        k=n20(n);
        else if(n>100)
        k=n100(n);
        printf("\n%d",k);
    }
}
int n1(int n)
{
    return n;
}
int n5(int n)
{
    if(n>=5)
    return (1 + n1(n-5));
    else
    return n1(n);
}
int n10(int n)
{
    if(n>=10)
    return (1 + n5(n-10));
    else
    return n5(n);
}
int n20(int n)
{
    if(n>=20)
    return (n/20 + n10(n-(n/20)*20));
    else
    return n10(n);
}
int n100(int n)
{
    if(n>100)
    return (n/100 + n20(n-(n/100)*100));
    else
    return n20(n);
}


/*
    Tardes de Coding Sesión 3
    B - Friends
    A01208964 - Doménica Rentería
*/

#include <stdio.h>

#define amigos 5

int main(){

int arr[amigos] = {};
int m, a, b;
// m -> # de relaciones entre los 5 amixes
// (a, b) relacion
// a -> persona 1
// b -> persona 2

scanf("%i", &m);
if (m == 0){
	printf("WIN\n");
	return 0;
}

int i=0;

// con este do-while, vamos a contar el numero de relaciones por persona
// con base a su número, si sale, se le suma al arreglo en su posición

do {
	scanf("%i %i", &a, &b);
    arr[a-1]++;
    //printf("arr[%i-1]++ %i\n", a, arr[a-1]++);
    arr[b-1]++;
    //printf("arr[%i-1]++ %i\n", b, arr[b-1]++);
	i++;
} while (i < m);

i=0;

// en este do-while checamos todo el arreglo
// si alguno tiene un valor diferente

do {
	if(arr[i] != 2){
    	printf("WIN\n");
    	return 0;
    }
	i++;
} while (i < amigos);

printf("FAIL\n");

return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int		main()
{
	int n_cone, i = 0, cont[6];
	scanf("%d", &n_cone);
	int l, r;
	int cnt = 0;
	int	tab[6];
	char *res = "FAIL";
	memset(tab, 0, sizeof(tab));
	while (n_cone > i)
	{
		scanf("%d%d", &l, &r);
		tab[l] = tab[l] + 1;
		tab[r] = tab[r] + 1;
		i++;
	}
	i = 1;
	while (i <= 5)
	{
		if (tab[i] != 2)
			res = "WIN";
		i++;
	}
	printf("%s", res);
	exit(0);
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int relations=0;
    int valor, aux, aux2, cont=0,  bandera=0;
    int n1=0, n2=0, n3=0, n4=0, n5=0;
    scanf("%i%*c", &relations);
    int pairwise[relations][2];

    int i=0, x=0;
    int j=0;
    for(i=0; i<relations; i++){
        for(j=0; j<2; j++){
                scanf("%i%*c", &valor);
                pairwise[i][j]=valor;
        }
    }

     if(relations<=4){
        printf("WIN");
     }
     else {
     /*aux=pairwise[0][0];
     aux2=pairwise[0][1];
    for(i=0; i<relations; i++){
            if(pairwise[i][0]==aux2){
               aux=pairwise[i][0];
               aux2=pairwise[i][1];
               cont++;
            }
            else if (pairwise[i][0]==aux){
                aux=pairwise[i][0];
                aux2=pairwise[i][1];
                cont++;
            }
            else{
                aux=pairwise[x++][0];
                aux2=pairwise[x][1];
                cont=0;
            }
    }*/

    for(i=0; i<relations; i++){
        for(j=0; j<2; j++){
           if(pairwise[i][j]==1){
            n1=n1+1;
           }
           else if(pairwise[i][j]==2){
            n2=n2+1;
           }
           else if(pairwise[i][j]==3){
            n3=n3+1;
           }
           else if(pairwise[i][j]==4){
            n4=n4+1;
           }
           else {
            n5=n5+1;
           }
        }
    }

    if(n1 >= 3 || n2 >= 3 ||  n3 >= 3  || n4 >= 3 || n5 >= 3 ){
        printf("WIN");
    }
    else printf("FAIL");
     }

}

#include <stdio.h>

int main(){
  int tabla[5][5];
  for(int i = 0; i < 5; i++){
    for(int j = 0; j < 5; j++){
      tabla[i][j] = 0;
    }
  }
  int n;
  scanf("%d", &n);

  for(int i = 0; i < n; i++){
    int a,b;
    scanf("%d %d", &a, &b);
    tabla[a-1][b-1] = 1;
    tabla[b-1][a-1] = 1;
  }

  int Igaz = 0;
  int Hamis = 0;

  for(int i = 0; i < 4; i++){
    for(int j = i+1; j < 5; j++){
      //printf("i:%d, j: %d\n", i, j);
      /* jarjuk be a tablat */
      int Helyes = 1;
      int Helytelen = 1;
      for(int k = 0; k < 5; k++){
	for(int l = 0; l < 5; l++){
	  if(!(k == i || k == j || l == i || l == j) && (k != l)){
	    //printf("k:%d, l: %d\n", k, l);
	    if(tabla[k][l] != 1) Helyes = 0;
	    if(tabla[k][l] == 1) Helytelen = 0;
	  }
	}
      }
      if(Helyes) Igaz = 1;
      if(Helytelen) Hamis = 1;

    }
  }

  if(Igaz || Hamis) printf("WIN");
  else printf("FAIL");
}

#include<stdio.h>

int main()
{
    int m,i,a[10]={0},l,r;
    scanf("%d",&m);
    while(m--)
    {
        scanf("%d%d",&l,&r);
        a[l]++;
        a[r]++;
    }
    for(i=1;i<=5;i++)
        if(a[i]>=3 || a[i]<2)
            break;
    if(i==6)
        printf("FAIL\n");
    else
        printf("WIN\n");
    return 0;
}

#include <stdio.h>
int main()
{
    int n, i, a[6]={0}, x, y;
    scanf("%d", &n);
    for(i=0; i<n; i++)
    {
        scanf("%d %d", &x, &y);
        a[x]++;
        a[y]++;
        if(a[x]==3 || a[y]==3)
        {
            printf("WIN\n");
            return 0;
        }
    }
    for(i=1; i<=5; i++)
        if(a[i]<=1)
        {
            printf("WIN\n");
            return 0;
        }
    printf("FAIL\n");
    return 0;
}

#include<stdio.h>

int main(void){
  int in1,in2,people[5];
  int m,n,i,flg=0;
  for(i=0;i<5;i++) people[i]=0;
  scanf("%d",&m);
  for(i=0;i<m;i++){
    scanf("%d %d",&in1,&in2);
    people[in1-1]++;
    people[in2-1]++;
  }
  for(i=0;i<5;i++){
    if(people[i]!=2){
      puts("WIN");
      flg=1;
      break;
    }
  }
  if(flg!=1) puts("FAIL");
  return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
	int i, j, k, relations[6][6] ;

	for (i = 0 ; i < 6 ; i++)
	{
		for (j = 0 ; j < 6 ; j++)
		{
			relations[i][j] = 0 ;
		}
	}

	scanf("%d", &k) ;

	while (k-- > 0)
	{
		scanf("%d %d", &i, &j) ;

		relations[i][j] = relations[j][i] = 1 ;
	}

	for (i = 1 ; i <= 3 ; i++)
	{
		for (j = i + 1 ; j <= 4 ; j++)
		{
			for (k = j + 1 ; k <= 5 ; k++)
			{
				if ((relations[i][j] && relations[j][k] && relations[k][i]) || !(relations[i][j] || relations[j][k] || relations[k][i]))
				{
					printf("WIN") ;
					return 0 ;
				}
			}
		}
	}

	printf("FAIL") ;

	return 0 ;
}

#include <stdio.h>
#include <string.h>
int main()
{
    int m;
    int i, j, k;
    int a, b;
    int map[11][11];
    while (scanf("%d", &m) == 1) {
        memset(map, 0, sizeof(map));
        for (i = 0; i < m; i++) {
            scanf("%d%d", &a, &b);
            map[a][b] = map[b][a] = 1;
        }
        for (i = 1; i <= 5; i++) {
        for (j = i+1; j <= 5; j++) {
        for (k = j+1; k <= 5; k++) {
            if (map[i][j] && map[j][k] && map[k][i]) {
                printf("WIN\n");
                goto X;
            }
            if (!map[i][j] && !map[j][k] && !map[k][i]) {
                printf("WIN\n");
                goto X;
            }
        }
        }
        }
        printf("FAIL\n");
X: ;
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int in(int a, int b);

int main()
{
        int r[10];
        int relations;
        int i;
        int x;
        int y;
        int one, two, three, four, five, six, seven, eight, nine, ten;

        for(i = 0; i < 10; i++)
        {
            r[i] = 0;
        }
        scanf("%d\n", &relations);
        for(i = 0; i < relations; i++)
        {
            scanf("%d %d\n", &x, &y);
            if(x < y)
                r[in(x,y)] = 1;
            else
                r[in(y,x)] = 1;
        }
/*
        for(i = 0; i < 10; i++)
            printf("%d\n", r[i]);
*/

        one = r[0]+r[1]+r[4];
        two = r[0]+r[2]+r[5];
        three = r[0]+r[3]+r[6];
        four =  r[1]+r[2]+r[7];
        five =  r[1]+r[3]+r[8];
        six =  r[2]+r[3]+r[9];
        seven =  r[4]+r[5]+r[7];
        eight =  r[4]+r[6]+r[8];
        nine =  r[5]+r[6]+r[9];
        ten =  r[7]+r[8]+r[9];

        /*printf("%d %d %d %d %d %d %d %d %d %d\n", one, two, three, four,
         * five, six, seven, eight, nine, ten);*/

        if((0 == one || 3 == one) || (0 == two || 3 ==two ) || (0 == three || 3 == three) || (0 == four || 3 == four) || (0 == five || 3 == five) || (0 == six || 3 == six) || (0 == seven || 3 == seven) || (0 == eight || 3 == eight) || (0 == nine || 3 == nine) || (0 == ten || 3 == ten))
            printf("WIN\n");
        else
            printf("FAIL\n");
}

/*return the index that the pair should be stored at*/
int in(int a, int b)
{
        if(1 == a)
        {
            if(2 == b)
                return 0;
            if(3 == b)
                return 1;
            if (4 == b)
                return 2;
            if (5 == b)
                return 3;
        }
        if (2 == a)
        {
            if(3 == b)
                return 4;
            if(4 == b)
                return 5;
            if(5 == b)
                return 6;
        }
        if (3 == a)
        {
            if(4 == b)
                return 7;
            if(5 == b)
                return 8;
        }
        if (4 == a)
        {
            if(5 == b)
                return 9;
        }
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int a[6][6];
int color[6];

int dfs(int v, int h, int id){
    int i, ans = 0;
    if (h > 3){
        return 0;
    }
    color[v] = h;
    for (i = 1; i < 6; i++){
        if (abs(id - a[v][i])){
            if (!color[i]){
                ans += dfs(i, h + 1, id);
            }else{
                if (h == 3 && color[i] == 1){
                    return 1;
                }
            }
        }
    }
    return ans;
}
int predfs(int id){
    int i, j, ans = 0;
    for (i = 1; i < 6; i++){
        for (j = 1; j < 6; j++){
            color[j] = 0;
        }
        if (!color[i]){
            ans += dfs(i, 1, id);
        }
    }
    return ans;
}
int main(void)
{
    int m, c, b = 1, i, j;
    scanf("%d", &m);
    for (i = 1; i < 6; i++){
        for (j = j; j < 6; j++){
            a[i][j] = 0;
        }
    }
    for (i = 0; i < m; i++){
        scanf("%d%d", &c, &b);
        a[c][b] = a[b][c] = 1;
    }
    if (predfs(1) || predfs(0)){
        printf("WIN");
    } else{
        printf("FAIL");
    }
    return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
	int m,i,a,b,x[10]={0};
	scanf("%d",&m);

		for(i=0;i<m;i++)
		{
			scanf("%d%d",&a,&b);
			x[a]++;x[b]++;
		}
		for(i=1;i<=5;i++)
		{
			if(x[i]!=2)
			{
				break;
			}
		}
		if(i>5)
		{
			printf("FAIL\n");
		}
		else
		{
			printf("WIN\n");
		}

	return 0;
}

/**
   nayeem
   dated, dhaka,
   30th June, 2011
   Codeforces 76
   Div 2
   B: Friends
**/

#include <stdio.h>
#include <string.h>

int p[] = {1, 2, 3, 4, 5};
int ans[3];
int G[6][6];

int backtrack(int ind, int pos)
{
    int i, j, node, w[3];
    if (pos == 3)
    {
       memset(w, 0, sizeof(w));
       node = ans[0];
       if (G[node][ans[1]] && G[node][ans[2]]) w[0] = 2;
       node = ans[1];
       if (G[node][ans[0]] && G[node][ans[2]]) w[1] = 2;
       node = ans[2];
       if (G[node][ans[0]] && G[node][ans[1]]) w[2] = 2;
       if (w[0] + w[1] + w[2] == 6)
       {
           return 1;
       }

       memset(w, -1, sizeof(w));
       node = ans[0];
       if (!G[node][ans[1]] && !G[node][ans[2]]) w[0] = 0;
       node = ans[1];
       if (!G[node][ans[0]] && !G[node][ans[2]]) w[1] = 0;
       node = ans[2];
       if (!G[node][ans[0]] && !G[node][ans[1]]) w[2] = 0;
       if (w[0] + w[1] + w[2] == 0)
       {
            return 1;
       }
       return 0;
    }
    for (i=ind; i<5; i++)
    {
        ans[pos] = p[i];
        if (backtrack(i + 1, pos + 1)) return 1;
    }
    return 0;
}

int main(void)
{
    int m, i, j, u, v;
    /*
    freopen("C:\\input.txt", "rt", stdin);
    freopen("C:\\output.txt", "wt", stdout);
    */
    while (1 == scanf("%d", &m))
    {
          memset(G, 0, sizeof(G));
          for (i=1; i<=m; i++)
          {
              scanf("%d %d", &u, &v);
              G[u][v] = 1;
              G[v][u] = 1;
          }

          if (backtrack(0, 0))
              printf("WIN\n");
          else
              printf("FAIL\n");
    }

    return 0;
}

#include <stdio.h>
int main()
{
    int n, i, a[6]={0}, x, y;
    scanf("%d", &n);
    for(i=0; i<n; i++)
    {
        scanf("%d %d", &x, &y);
        a[x]++;
        a[y]++;
        if(a[x]==3 || a[y]==3)
        {
            printf("WIN\n");
            return 0;
        }
    }
    for(i=1; i<=5; i++)
        if(a[i]==1)
        {
            printf("WIN\n");
            return 0;
        }
    printf("FAIL\n");
    return 0;
}

#include<stdio.h>

int main(void){
  int in1,in2,people[5];
  int m,n,i,flg=0;
  for(i=0;i<5;i++) people[i]=0;
  scanf("%d",&m);
  for(i=0;i<m;i++){
    scanf("%d %d",&in1,&in2);
    people[in1]++;
    people[in2]++;
  }
  for(i=0;i<5;i++){
    if(people[i]==1 || people[i]==3){
      puts("WIN");
      flg=1;
      break;
    }
  }
  if(flg!=1) puts("FAIL");
  return 0;
}

#include<stdio.h>

int main(void){
  int in1,in2,people[5];
  int m,n,i,flg=0;
  for(i=0;i<5;i++) people[i]=0;
  scanf("%d",&m);
  for(i=0;i<m;i++){
    scanf("%d %d",&in1,&in2);
    people[in1-1]++;
    people[in2-1]++;
  }
  for(i=0;i<5;i++){
    if(people[i]==1 || people[i]==3){
      puts("WIN");
      flg=1;
      break;
    }
  }
  if(flg!=1) puts("FAIL");
  return 0;
}

#include <stdio.h>
#include <stdlib.h>

int quantidade_de_amigos(int *amigos) {

	int i;

	for(i = 0; i < 5; i++) {

		if(amigos[i] >= 3) {
			return 1;
		}
	}

	return 0;
}

void percorre_vetor(int *v, int n, int *amigos) {

	int i, j, elemento = 1, contador;
	contador = 0;

	for(i = 0; i < 5; i++) {

		contador = 0;
		for(j = 0; j < n; j++) {

			if(v[j] == elemento) {
				contador++;
			}
		}

		amigos[i] = contador;
		elemento++;
	}
}

int main() {

	int i, n;

	scanf("%d", &n);

	int *v = (int*) malloc((2 * n) * sizeof(int));
	int *amigos = (int*) malloc(5 * sizeof(int));

	for(i = 0; i < (2 * n); i++) {

		scanf("%d", &v[i]);
	}

	percorre_vetor(v, (2 * n), amigos);

	if(n == 1) {
		printf("WIN\n");
	}
	else if(quantidade_de_amigos(amigos)) {
		printf("WIN\n");
	}
	else {
		printf("FAIL\n");
	}

	free(v);
	free(amigos);

	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int quantidade_de_amigos(int *amigos) {

	int i;

	for(i = 0; i < 5; i++) {

		if(amigos[i] >= 3) {
			return 1;
		}
	}

	return 0;
}

void percorre_vetor(int *v, int n, int *amigos) {

	int i, j, elemento = 1, contador;
	contador = 0;

	for(i = 0; i < 5; i++) {

		contador = 0;
		for(j = 0; j < n; j++) {

			if(v[j] == elemento) {
				contador++;
			}
		}

		amigos[i] = contador;
		elemento++;
	}
}

int main() {

	int i, n;

	scanf("%d", &n);

	int *v = (int*) malloc((2 * n) * sizeof(int));
	int *amigos = (int*) malloc(5 * sizeof(int));

	for(i = 0; i < (2 * n); i++) {

		scanf("%d", &v[i]);
	}

	percorre_vetor(v, (2 * n), amigos);

	if(quantidade_de_amigos(amigos)) {
		printf("WIN\n");
	}
	else {
		printf("FAIL\n");
	}

	free(v);
	free(amigos);

	return 0;
}

#include <stdio.h>
#include <string.h>
int main()
{
    int m;
    int i, j, k;
    int a, b;
    int map[11][11];
    while (scanf("%d", &m) == 1 && m) {
        memset(map, 0, sizeof(map));
        for (i = 0; i < m; i++) {
            scanf("%d%d", &a, &b);
            map[a][b] = map[b][a] = 1;
        }
        for (i = 1; i <= 5; i++) {
        for (j = i+1; j <= 5; j++) {
        for (k = j+1; k <= 5; k++) {
            if (map[i][j] && map[j][k] && map[k][i]) {
                printf("WIN\n");
                goto X;
            }
            if (!map[i][j] && !map[j][k] && !map[k][i]) {
                printf("WIN\n");
                goto X;
            }
        }
        }
        }
        printf("FAIL\n");
X: ;
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int a[6][6];
int color[6];

int dfs(int v, int h, int id){
    int i, ans = 0;
    color[v] = h;
    for (i = 1; i < 6; i++){
        if (abs(id - a[v][i])){
            if (!color[i]){
                ans += dfs(i, h + 1, id);
            }else{
                if (h + 1 - color[i] == 3){
                    ans = 1;
                }
            }
        }
    }
    return ans;
}
int predfs(int id){
    int i, ans = 0;
    for (i = 1; i < 6; i++){
        color[i] = 0;
    }
    for (i = 1; i < 6; i++){
        if (!color[i]){
            ans += dfs(i, 1, id);
        }
    }
    return ans;
}
int main(void)
{
    int m, c, b = 1, i, j;
    scanf("%d", &m);
    for (i = 1; i < 6; i++){
        for (j = j; j < 6; j++){
            a[i][j] = 0;
        }
    }
    for (i = 0; i < m; i++){
        scanf("%d%d", &c, &b);
        a[c][b] = a[b][c] = 1;
    }
    if (predfs(1) || predfs(0)){
        printf("WIN");
    } else{
        printf("FAIL");
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int a[6][6];
int color[6];

int dfs(int v, int h, int id){
    int i, ans = 0;
    color[v] = h;
    for (i = 1; i < 6; i++){
        if (abs(id - a[v][i])){
            if (!color[i]){
                ans += dfs(i, h + 1, id);
            }else{
                if (h + 1 - color[i] == 3){
                    ans = 1;
                }
            }
        }
    }
    return ans;
}

int main(void)
{
    int m, c, b, i, j;
    scanf("%d", &m);
    for (i = 1; i < 6; i++){
        for (j = j; j < 6; j++){
            a[i][j] = 0;
        }
    }
    for (i = 0; i < m; i++){
        scanf("%d%d", &c, &b);
        a[c][b] = a[b][c] = 1;
    }
    if (dfs(b, 1, 1) || dfs(b, 1, 0)){
        printf("WIN");
    } else{
        printf("FAIL");
    }
    return 0;
}

/*
    Tardes de Coding Sesión 3
    B - Friends
    A01208964 - Doménica Rentería
*/

#include <stdio.h>

#define amigos 5

int main(){

int arr[amigos] = {};
int m, a, b;
// m -> # de relaciones entre los 5 amixes
// (a, b) relacion
// a -> persona 1
// b -> persona 2

scanf("%i", &m);

int i=0;

// con este do-while, vamos a contar el numero de relaciones por persona
// con base a su número, si sale, se le suma al arreglo en su posición

do {
	scanf("%i %i", &a, &b);
    arr[a-1]++;
    //printf("arr[%i-1]++ %i\n", a, arr[a-1]++);
    arr[b-1]++;
    //printf("arr[%i-1]++ %i\n", b, arr[b-1]++);
	i++;
} while (i < m);

i=0;

// en este do-while checamos todo el arreglo
// si alguno tiene un valor diferente

do {
	if(arr[i] > 2){
    	printf("WIN\n");
    	return 0;
    }
	i++;
} while (i < amigos);

printf("FAIL\n");

return 0;
}

/*
    Tardes de Coding Sesión 3
    B - Friends
    A01208964 - Doménica Rentería
*/

#include <stdio.h>

#define amigos 5

int main(){

int arr[amigos] = {};
int m, a, b;
// m -> # de relaciones entre los 5 amixes
// (a, b) relacion
// a -> persona 1
// b -> persona 2

scanf("%i", &m);
if (m==0){
	return 0;
}

int i=0;

// con este do-while, vamos a contar el numero de relaciones por persona
// con base a su número, si sale, se le suma al arreglo en su posición

do {
	scanf("%i %i", &a, &b);
    arr[a-1]++;
    //printf("arr[%i-1]++ %i\n", a, arr[a-1]++);
    arr[b-1]++;
    //printf("arr[%i-1]++ %i\n", b, arr[b-1]++);
	i++;
} while (i < m);

i=0;

// en este do-while checamos todo el arreglo
// si alguno tiene un valor diferente

do {
	if(arr[i] != 2){
    	printf("WIN\n");
    	return 0;
    }
	i++;
} while (i < amigos);

printf("FAIL\n");

return 0;
}

/*
    Tardes de Coding Sesión 3
    B - Friends
    A01208964 - Doménica Rentería
*/

#include <stdio.h>

#define amigos 5

int main(){

int arr[amigos] = {};
int m, a, b;
// m -> # de relaciones entre los 5 amixes
// (a, b) relacion
// a -> persona 1
// b -> persona 2

scanf("%i", &m);
if (m=0){
	return 0;
}

int i=0;

// con este do-while, vamos a contar el numero de relaciones por persona
// con base a su número, si sale, se le suma al arreglo en su posición

do {
	scanf("%i %i", &a, &b);
    arr[a-1]++;
    //printf("arr[%i-1]++ %i\n", a, arr[a-1]++);
    arr[b-1]++;
    //printf("arr[%i-1]++ %i\n", b, arr[b-1]++);
	i++;
} while (i < m);

i=0;

// en este do-while checamos todo el arreglo
// si alguno tiene un valor diferente

do {
	if(arr[i] != 2){
    	printf("WIN\n");
    	return 0;
    }
	i++;
} while (i < amigos);

printf("FAIL\n");

return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int		main()
{
	int n_cone, i = 0, cont[6];

	scanf("%d", &n_cone);
	int l, r;
	int cnt = 0;
	int	tab[5];
	char *res = "FAIL";
	memset(tab, 0, sizeof(tab));
	while (n_cone > i)
	{
		scanf("%d%d", &l, &r);
		tab[l] = tab[l] + 1;
		tab[r] = tab[r] + 1;
		i++;
	}
	i = 1;
	while (i <= 5)
	{
		if (tab[i] != 2)
			res = "WIN";
		i++;
	}
		printf("%s", res);
	exit(0);
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int		main()
{
	int n_cone, i = 0, cont[6];

	scanf("%d", &n_cone);
	int l, r;
	int cnt = 0;
	int	tab[5];
	char *res = "FAIL";
	memset(tab, 0, sizeof(tab));
	while (n_cone > i)
	{
		scanf("%d%d", &l, &r);
		tab[l] = tab[l] + 1;
		tab[r] = tab[r] + 1;
		i++;
	}
	i = 1;
	while (i <= 5)
	{
		if (tab[i] != 2)
			res = "WIN";
		i++;
	}
	if (strcmp(res, "FAIL"))
		printf("WIN");
	else
		printf("FAIL\n");
	exit(0);
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int relations=0;
    int valor, aux, aux2, cont=0,  bandera=0;
    int n1=0, n2=0, n3=0, n4=0, n5=0;
    scanf("%i%*c", &relations);
    int pairwise[relations][2];

    int i=0, x=0;
    int j=0;
    for(i=0; i<relations; i++){
        for(j=0; j<2; j++){
                scanf("%i%*c", &valor);
                pairwise[i][j]=valor;
        }
    }

     if(relations<4){
        printf("WIN");
     }
     else {
     aux=pairwise[0][0];
     aux2=pairwise[0][1];
    for(i=0; i<relations; i++){
            if(pairwise[i][0]==aux2){
               aux=pairwise[i][0];
               aux2=pairwise[i][1];
               cont++;
            }
            else if (pairwise[i][0]==aux){
                aux=pairwise[i][0];
                aux2=pairwise[i][1];
                cont++;
            }
            else{
                aux=pairwise[x++][0];
                aux2=pairwise[x][1];
                cont=0;
            }
    }

    for(i=0; i<relations; i++){
        for(j=0; j<2; j++){
           if(pairwise[i][j]==1){
            n1=n1+1;
           }
           else if(pairwise[i][j]==2){
            n2=n2+1;
           }
           else if(pairwise[i][j]==3){
            n3=n3+1;
           }
           else if(pairwise[i][j]==4){
            n4=n4+1;
           }
           else {
            n5=n5+1;
           }
        }
    }

    if(n1 >= 3 || n2 >= 3 ||  n3 >= 3  || n4 >= 3 || n5 >= 3){
        printf("WIN");
    }
    else printf("FAIL");
     }

}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int relations=0;
    int valor, aux, aux2, cont=0,  bandera=0;
    int n1=0, n2=0, n3=0, n4=0, n5=0;
    scanf("%i%*c", &relations);
    int pairwise[relations][2];

    int i=0, x=0;
    int j=0;
    for(i=0; i<relations; i++){
        for(j=0; j<2; j++){
                scanf("%i%*c", &valor);
                pairwise[i][j]=valor;
        }
    }

     aux=pairwise[0][0];
     aux2=pairwise[0][1];

    for(i=0; i<relations; i++){
            if(pairwise[i][0]==aux2){
               aux=pairwise[i][0];
               aux2=pairwise[i][1];
               cont++;
            }
            else if (pairwise[i][0]==aux){
                aux=pairwise[i][0];
                aux2=pairwise[i][1];
                cont++;
            }
            else{
                aux=pairwise[x++][0];
                aux2=pairwise[x][1];
                cont=0;
            }
    }

    for(i=0; i<relations; i++){
        for(j=0; j<2; j++){
           if(pairwise[i][j]==1){
            n1=n1+1;
           }
           else if(pairwise[i][j]==2){
            n2=n2+1;
           }
           else if(pairwise[i][j]==3){
            n3=n3+1;
           }
           else if(pairwise[i][j]==4){
            n4=n4+1;
           }
           else {
            n5=n5+1;
           }
        }
    }

    if(n1 ==3 || n2 == 3 ||  n3 ==3  || n4 == 3 || n5 == 3  || cont ==3 ){
        printf("WIN");
    }
    else printf("FAIL");

}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int relations=0;
    int valor, aux, aux2, cont=0,  bandera=0;
    int n1=0, n2=0, n3=0, n4=0, n5=0;
    scanf("%i%*c", &relations);
    int pairwise[relations][2];

    int i=0, x=0;
    int j=0;
    for(i=0; i<relations; i++){
        for(j=0; j<2; j++){
                scanf("%i%*c", &valor);
                pairwise[i][j]=valor;
        }
    }

     if(relations<4){
        printf("WIN");
     }
     else {
    /* aux=pairwise[0][0];
     aux2=pairwise[0][1];
    for(i=0; i<relations; i++){
            if(pairwise[i][0]==aux2){
               aux=pairwise[i][0];
               aux2=pairwise[i][1];
               cont++;
            }
            else if (pairwise[i][0]==aux){
                aux=pairwise[i][0];
                aux2=pairwise[i][1];
                cont++;
            }
            else{
                aux=pairwise[x++][0];
                aux2=pairwise[x][1];
                cont=0;
            }
    }*/

    for(i=0; i<relations; i++){
        for(j=0; j<2; j++){
           if(pairwise[i][j]==1){
            n1=n1+1;
           }
           else if(pairwise[i][j]==2){
            n2=n2+1;
           }
           else if(pairwise[i][j]==3){
            n3=n3+1;
           }
           else if(pairwise[i][j]==4){
            n4=n4+1;
           }
           else {
            n5=n5+1;
           }
        }
    }

    if(n1 >= 3 || n2 >= 3 ||  n3 >= 3  || n4 >= 3 || n5 >= 3){
        printf("WIN");
    }
    else printf("FAIL");
     }

}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int relations=0;
    int valor, aux, aux2, cont=0,  bandera=0;
    int n1=0, n2=0, n3=0, n4=0, n5=0;
    scanf("%i%*c", &relations);
    int pairwise[relations][2];

    int i=0, x=0;
    int j=0;
    for(i=0; i<relations; i++){
        for(j=0; j<2; j++){
                scanf("%i%*c", &valor);
                pairwise[i][j]=valor;
        }
    }

     aux=pairwise[0][0];
     aux2=pairwise[0][1];
     if(relations==1){
        printf("WIN");
     }
     else {
    for(i=0; i<relations; i++){
            if(pairwise[i][0]==aux2){
               aux=pairwise[i][0];
               aux2=pairwise[i][1];
               cont++;
            }
            else if (pairwise[i][0]==aux){
                aux=pairwise[i][0];
                aux2=pairwise[i][1];
                cont++;
            }
            else{
                aux=pairwise[x++][0];
                aux2=pairwise[x][1];
                cont=0;
            }
    }

    for(i=0; i<relations; i++){
        for(j=0; j<2; j++){
           if(pairwise[i][j]==1){
            n1=n1+1;
           }
           else if(pairwise[i][j]==2){
            n2=n2+1;
           }
           else if(pairwise[i][j]==3){
            n3=n3+1;
           }
           else if(pairwise[i][j]==4){
            n4=n4+1;
           }
           else {
            n5=n5+1;
           }
        }
    }

    if(n1 ==3 || n2 == 3 ||  n3 ==3  || n4 == 3 || n5 == 3  || cont ==3 ){
        printf("WIN");
    }
    else printf("FAIL");
     }

}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int relations=0;
    int valor, aux, aux2, cont=0,  bandera=0;
    int n1=0, n2=0, n3=0, n4=0, n5=0;
    scanf("%i%*c", &relations);
    int pairwise[relations][2];

    int i=0, x=0;
    int j=0;
    for(i=0; i<relations; i++){
        for(j=0; j<2; j++){
                scanf("%i%*c", &valor);
                pairwise[i][j]=valor;
        }
    }

     aux=pairwise[0][0];
     aux2=pairwise[0][1];
     if(relations<4){
        printf("WIN");
     }
     else {
    for(i=0; i<relations; i++){
            if(pairwise[i][0]==aux2){
               aux=pairwise[i][0];
               aux2=pairwise[i][1];
               cont++;
            }
            else if (pairwise[i][0]==aux){
                aux=pairwise[i][0];
                aux2=pairwise[i][1];
                cont++;
            }
            else{
                aux=pairwise[x++][0];
                aux2=pairwise[x][1];
                cont=0;
            }
    }

    for(i=0; i<relations; i++){
        for(j=0; j<2; j++){
           if(pairwise[i][j]==1){
            n1=n1+1;
           }
           else if(pairwise[i][j]==2){
            n2=n2+1;
           }
           else if(pairwise[i][j]==3){
            n3=n3+1;
           }
           else if(pairwise[i][j]==4){
            n4=n4+1;
           }
           else {
            n5=n5+1;
           }
        }
    }

    if(n1 ==3 || n2 == 3 ||  n3 ==3  || n4 == 3 || n5 == 3  || cont ==3 ){
        printf("WIN");
    }
    else printf("FAIL");
     }

}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int relations=0;
    int valor, aux, aux2, cont=0,  bandera=0;
    int n1=0, n2=0, n3=0, n4=0, n5=0;
    scanf("%i%*c", &relations);
    int pairwise[relations][2];

    int i=0, x=0;
    int j=0;
    for(i=0; i<relations; i++){
        for(j=0; j<2; j++){
                scanf("%i%*c", &valor);
                pairwise[i][j]=valor;
        }
    }

     if(relations<4){
        printf("WIN");
     }
     else {
    /* aux=pairwise[0][0];
     aux2=pairwise[0][1];
    for(i=0; i<relations; i++){
            if(pairwise[i][0]==aux2){
               aux=pairwise[i][0];
               aux2=pairwise[i][1];
               cont++;
            }
            else if (pairwise[i][0]==aux){
                aux=pairwise[i][0];
                aux2=pairwise[i][1];
                cont++;
            }
            else{
                aux=pairwise[x++][0];
                aux2=pairwise[x][1];
                cont=0;
            }
    }*/

    for(i=0; i<relations; i++){
        for(j=0; j<2; j++){
           if(pairwise[i][j]==1){
            n1=n1+1;
           }
           else if(pairwise[i][j]==2){
            n2=n2+1;
           }
           else if(pairwise[i][j]==3){
            n3=n3+1;
           }
           else if(pairwise[i][j]==4){
            n4=n4+1;
           }
           else {
            n5=n5+1;
           }
        }
    }

    if(n1 > 3 || n2 > 3 ||  n3 > 3  || n4 > 3 || n5 > 3  || cont ==3 ){
        printf("WIN");
    }
    else printf("FAIL");
     }

}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int relations=0;
    int valor, aux, aux2, cont=0,  bandera=0;
    int n1=0, n2=0, n3=0, n4=0, n5=0;
    scanf("%i%*c", &relations);
    int pairwise[relations][2];

    int i=0, x=0;
    int j=0;
    for(i=0; i<relations; i++){
        for(j=0; j<2; j++){
                scanf("%i%*c", &valor);
                pairwise[i][j]=valor;
        }
    }

     if(relations<4){
        printf("WIN");
     }
     else {
     aux=pairwise[0][0];
     aux2=pairwise[0][1];
    for(i=0; i<relations; i++){
            if(pairwise[i][0]==aux2){
               aux=pairwise[i][0];
               aux2=pairwise[i][1];
               cont++;
            }
            else if (pairwise[i][0]==aux){
                aux=pairwise[i][0];
                aux2=pairwise[i][1];
                cont++;
            }
            else{
                aux=pairwise[x++][0];
                aux2=pairwise[x][1];
                cont=0;
            }
    }

    for(i=0; i<relations; i++){
        for(j=0; j<2; j++){
           if(pairwise[i][j]==1){
            n1=n1+1;
           }
           else if(pairwise[i][j]==2){
            n2=n2+1;
           }
           else if(pairwise[i][j]==3){
            n3=n3+1;
           }
           else if(pairwise[i][j]==4){
            n4=n4+1;
           }
           else {
            n5=n5+1;
           }
        }
    }

    if(n1 >= 3 || n2 >= 3 ||  n3 >= 3  || n4 >= 3 || n5 >= 3  || cont >= 3){
        printf("WIN");
    }
    else printf("FAIL");
     }

}

#include <stdio.h>

int main(){
  int n;
  scanf("%d", &n);
  int tabla[5][5];
  for(int i = 0; i < n; i++){
    for(int j = 0; j < n; j++){
      tabla[i][j] = 0;
    }
  }
  for(int i = 0; i < n; i++){
    int a,b;
    scanf("%d %d", &a, &b);
    tabla[a-1][b-1] = 1;
    tabla[b-1][a-1] = 1;
  }

  int Igaz = 0;

  for(int i = 0; i < 4; i++){
    for(int j = i+1; j < 5; j++){
      //printf("i:%d, j: %d\n", i, j);
      /* jarjuk be a tablat */
      int Helyes = 1;
      int Helytelen = 1;
      for(int k = 0; k < 5; k++){
	for(int l = 0; l < 5; l++){
	  if(!(k == i || k == j || l == i || l == j)){
	    //printf("k:%d, l: %d\n", k, l);
	    if(tabla[k][l] != 1) Helyes = 0;
	    if(tabla[k][l] == 1) Helytelen = 0;
	  }
	}
      }
      //if(Helyes) printf("helyes\n");
      //if(Helytelen) printf("helytelen\n");
      if(Helyes || Helytelen){
	Igaz = 1;
      }

    }
  }

  if(Igaz) printf("WIN");
  else printf("FAIL");
}