Everybody is worried about Rakesh as the boy does not have much knowledge about the real world. He can not go from one place to another on his own. It's high time he learned to explore the city. He is going to a relative's house situated on the other side of the city on his own. As this is his first time, he is carrying a GPS tracker of a special kind. The tracker continuously sends information to the family of Rakesh about his movement. The information is sent using the following four letters: U, D, R, and L. Those letters indicate the moves taken by Rakesh. 

The city can be considered as a grid. Rakesh starts his journey from (0, 0) position of the grid. His relative's house is situated at (Rx, Ry). Rakesh can move in four directions: up, down, right, or left indicated by U, D, R, and L respectively. 

Any position of the city with x ordinate negative or greater than M is considered as dangerous. Also, any position of the city with y ordinate negative or greater than N is considered as dangerous. You will be given the total sequence of Rakesh's movement. You need to determine if Rakesh ended up being at his relative's house, at a dangerous place, or at a random place in the city.

To make things clear,

-  U indicates a move that increases position along y-axis by 1 
-  D indicates a move that decreases position along y-axis by 1 
-  R indicates a move that increases position along x-axis by 1 
-  L indicates a move that decreases position along x-axis by 1 

Note that we are interested in the position of Rakesh at the end of his journey only. He may visit some dangerous place or his relative's house at some intermediate point but that won't affect the answer.

-----Input-----
- The first line of the input contains an integer T denoting the number of test cases. The description of each test case follows.

- The first line of each test case contains two integers M and N.
- The second line contains two integers Rx and Ry.
- The third line contains the length of Rakesh's move sequence.
- The next line contains the move sequence containing letters U, D, R, and L only with no space.

-----Output-----
For each test case, print "Case i: ", and then the answer, where i is the testcase number, 1-indexed. The answer should be any of the following three strings:
-  "REACHED" if Rakesh could reach his relative's house 
-  "DANGER" if Rakesh ended up being in a dangerous place 
-  "SOMEWHERE" if Rakesh ended up being in somewhere safe place in the city other than his relative's place 
Don't print any quotation mark. Check the sample output.

-----Constraints-----

- 1 ≤ T ≤ 10
- 0 ≤ M, N ≤ 10000
- 0 ≤ Rx ≤  M 
- 0 ≤ Ry ≤  N 
- 0 ≤ Sum of the lengths of all sequences ≤ 10000

-----Example-----
Input:
2
20 20
4 5
13
LLUUUUURRRRRR
10 10
3 4
7
UDUDDRR

Output:
Case 1: REACHED
Case 2: DANGER

```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 = "#code\nt = int(input())\nc = 1\nwhile t>0:\n inp = [int(i) for i in input().split(' ')]\n m = inp[0]\n n = inp[1]\n inp = [int(i) for i in input().split(' ')]\n rx = inp[0]\n ry = inp[1]\n path_len = int(input())\n path = input()\n \n # print(path)\n posx = 0\n posy = 0\n for p in path:\n  if p == 'L':\n   posx -= 1\n  elif p == 'R':\n   posx += 1\n  elif p == 'U':\n   posy += 1\n  elif p == 'D':\n   posy -= 1\n \n if posx > m or posx < 0 or posy > n or posy < 0:\n  print('Case ' + str(c) + ': ' + 'DANGER')\n elif posx != rx or posy != ry:\n  print('Case ' + str(c) + ': ' + 'SOMEWHERE')\n elif posx == rx and posy == ry:\n  print('Case ' + str(c) + ': ' + 'REACHED')\n t -= 1\n c += 1"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13481