There is a rectangular grid of cells consisting of n rows and m columns.
You will place a robot on one of the grid cells and provide it with a command string s, consisting of characters ‘L’, ‘R’, ‘U’, ‘D’.
After being placed, the robot will follow the instructions of the command string, where 'L' corresponds moving to the left, 'R' towards the right, 'U' for moving up, and 'D' means down.

You have already selected the command string s, and are wondering if it is possible to place the robot in one of the grid cells initially and have it always stay entirely within the grid upon execution of the command string s.
Output “safe” if there is a starting cell for which the robot doesn’t fall off the grid on following command s, otherwise, output "unsafe".

-----Input-----

The first line of input will contain an integer T, the number of test cases.

Each test case will be on two lines. 

The first line will have two space separated integers n,m. 

The second line will have the command string s.

-----Output-----

For each test case, output "safe" (without quotes) or "unsafe" (without quotes) in a new line.

-----Constraints-----
-  1 ≤ T ≤ 1,000
-  1 ≤ n,m ≤ 10
-  1 ≤ |s| ≤ 10

-----Example-----
Input:
5
1 1
R
2 3
LLRU
3 2
LLRU
4 3
ULURUDRDLD
3 6
RURUR

Output:
unsafe
safe
unsafe
safe
safe

-----Explanation-----

For the first case, there is only one grid square, so we must place our robot there. When the robot follows the command, it'll fall off, so it is unsafe.

For the second case, we can place the robot on the bottom right grid square. Here is an image denoting the moves that the robot will make.

```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 = "t=int(input())\nfor l in range(t):\n n,m=list(map(int,input().split()))\n a=False\n s=input()\n for i in range(1,n+1):\n  \n  for j in range(1,m+1):\n   x=i\n   y=j\n   loulou=False\n   for h in range(len(s)):\n    \n    if s[h]=='L':\n     y=y-1\n    elif s[h]=='R':\n     y=y+1\n    elif s[h]=='U':\n     x=x+1\n    else:\n     x=x-1\n    if x<1 or x>n or y<1 or y>m :\n     loulou=True\n     \n     break\n     \n    \n    \n   if loulou==False :\n    a=True\n    \n    print('safe')\n    break\n  if a==True:\n   break\n if a==False:\n  print('unsafe')\n"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13329