This is a simple game you must have played around with during your school days, calculating FLAMES of you and your crush! Given the names of two people, cancel out the common letters (repeated occurrence of a letter is treated separately, so 2A's in one name and one A in the other would cancel one A in each name), count the total number of remaining letters (n) and repeatedly cut the letter in the word FLAMES which hits at the nth number when we count from F in cyclic manner.

For example:
NAME 1: SHILPA
NAME 2: AAMIR
After cutting the common letters: 
NAME 1: SHILPA 
NAME 2: AAMIR
Total number of letters left=7
FLAMES, start counting from F : 1=F, 2=L, 3=A, 4=M, 5=E, 6=S,7=F...So cut F
FLAMES: repeat this process with remaining letters of FLAMES for number 7 (start count from the letter after 
the last letter cut) . In the end, one letter remains. Print the result corresponding to the last letter:
F=FRIENDS
L=LOVE
A=ADORE
M=MARRIAGE
E=ENEMIES
S=SISTER

-----Input-----
The no. of test cases (<100)
two names (may include spaces) for each test case.


-----Output-----
FLAMES result (Friends/Love/...etc) for each test case

-----Example-----
Input:
2
SHILPA
AAMIR
MATT
DENISE

Output:
ENEMIES
LOVE



By:
Chintan, Asad, Ashayam, Akanksha

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = "import sys\n\nalpha='abcdefghijklmnopqrstuvwxyz'\n\nfor _ in range(int(sys.stdin.readline())):\n    n1=sys.stdin.readline().strip().lower().replace(' ','')\n    n2=sys.stdin.readline().strip().lower().replace(' ','')\n    \n    common=[0 for i in range(26)]\n    \n    for i in range(26):\n        t1=n1.count(alpha[i])\n        t2=n2.count(alpha[i])\n        \n        if t1==t2:\n            common[i]=t1\n        else:\n            common[i]=min([t1,t2])\n            \n    for a in range(26):\n        n1=n1.replace(alpha[a],'',common[a])\n        n2=n2.replace(alpha[a],'',common[a])\n        \n    remain=len(n1)+len(n2)\n    \n    f=['f','l','a','m','e','s']\n    index=0\n    while len(f)>1 and remain!=0:\n    \n        l=remain%len(f)-1\n\n        del f [l]\n        \n        if l!=0 and l!=-1:\n            f=f[l:]+f[:l]\n        \n    if f[0]=='f'and remain!=0:\n        print('FRIENDS')\n    elif f[0]=='l':\n        print('LOVE')\n    elif f[0]=='a':\n        print('ADORE')\n    elif f[0]=='m':\n        print('MARRIAGE')\n    elif f[0]=='e':\n        print('ENEMIES')\n    elif f[0]=='s':\n        print('SISTER')\n    elif remain==0:\n        print('SISTER')"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 14239