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 = "#!/usr/bin/env python\n\nWORDS = {'F':'FRIENDS',  'L':'LOVE',    'A':'ADORE',\n         'M':'MARRIAGE', 'E':'ENEMIES', 'S':'SISTER'}\n\ndef process(N1, N2):\n    N3 = ''\n    for i in range(len(N1)):\n        v = N2.find(N1[i])\n        if v != -1: N2 = N2[:v] + N2[v+1:]\n        else:       N3 = N3 + N1[i]\n    N = len(N3 + N2)\n    if N == 0: return 'SISTER' # ???\n    ar = 'FLAMES'\n    stp = 1\n    for x in range(6, 1, -1):\n        g = ((N%x)+stp)-1\n        if g>x:\n           g=g%x\n        if g==0:\n           g=len(ar)\n        ar = ar[:g-1] + ar[g:]\n        stp=g\n    return WORDS[ar]\n\ndef main():\n    T = int(input())\n    for t in range(T):\n        N1 = input()\n        N2 = input()\n        N1 = N1.upper().replace(' ', '') # ???\n        N2 = N2.upper().replace(' ', '') # ???\n        print(process(N1, N2))\n\nmain()\n"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13951