Package for this problem was not updated by the problem writer or Codeforces administration after we’ve upgraded the judging servers. To adjust the time limit constraint, solution execution time will be multiplied by 2. For example, if your solution works for 400 ms on judging servers, then value 800 ms will be displayed and used to determine the verdict.

The following languages are only available languages for the problems from the contest

Unknown Language Round #3:

- Pike 7.8

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ACM-ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

B. Friendly Numbers

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputKiana thinks two integers are friends if and only if one of them divides the other one. For example, 12 and 4 are friends, also 6 and 6 are friends too, but 120 and 36 are not.

A group of non-zero integers is called friendly, if each pair of its integers form a friend pair.

You are given a group of non-zero integers. See if they're friendly.

Input

The first line contains *n* (1 ≤ *n* ≤ 1000), where *n* — the number of integers in the group.

The next line contains the elements, sorted in the non-decreasing order. The numbers are comma separated, they have at most 7 digits in their decimal notation and do not have any leading zeros.

Output

If the group is friendly write "FRIENDS", else write "NOT FRIENDS".

Examples

Input

4

1,3,6,12

Output

FRIENDS

Input

3

1,2,9

Output

NOT FRIENDS

Codeforces (c) Copyright 2010-2018 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jun/25/2018 03:01:53 (d2).

Desktop version, switch to mobile version.

User lists

Name |
---|