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 string\n\nt=int(input().strip())\nfor _ in range(0,t):\n\ta=input().strip()\n\tb=input().strip()\n\td={}\n\te={}\n\tla=0\n\tlb=0\n\tfor i in a:\n\t\ti=i.upper()\n\t\tif (i==\' \'):\n\t\t\tcontinue\n\t\ttry:\n\t\t\td[i]+=1\n\t\texcept:\n\t\t\td[i]=1\n\t\tla+=1\n\tfor i in b:\n\t\ti=i.upper()\n\t\tif (i==\' \'):\n\t\t\tcontinue\n\t\ttry:\n\t\t\te[i]+=1\n\t\texcept:\n\t\t\te[i]=1\n\t\tlb+=1\n\tleft=la+lb\n##\tprint d\n\tfor i in d:\n\t\ttry:\n\t\t\te[i]+=0\n\t\texcept:\n\t\t\tcontinue\n\t\tif (d[i]<e[i]):\n\t\t\tleft-=(2*d[i])\n\t\telse:\n\t\t\tleft-=(2*e[i])\n##        print left\n\tf = [\'F\',\'L\',\'A\',\'M\',\'E\',\'S\']\n\told=0\n\tfor q in range(0,5):\n\t\told=(((left%(6-q))+old)%(6-q)-1)%(6-q)\n\t\tf.pop(old)\n\tans={\'F\':"FRIENDS", \'L\':"LOVE", \'A\':"ADORE", \'M\':"MARRIAGE", \'E\':"ENEMIES", \'S\':"SISTER"}\n\tprint(ans[f[0]])'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13615