You a captain of a ship. Initially you are standing in a point $(x_1, y_1)$ (obviously, all positions in the sea can be described by cartesian plane) and you want to travel to a point $(x_2, y_2)$. 

You know the weather forecast — the string $s$ of length $n$, consisting only of letters U, D, L and R. The letter corresponds to a direction of wind. Moreover, the forecast is periodic, e.g. the first day wind blows to the side $s_1$, the second day — $s_2$, the $n$-th day — $s_n$ and $(n+1)$-th day — $s_1$ again and so on. 

Ship coordinates change the following way:  if wind blows the direction U, then the ship moves from $(x, y)$ to $(x, y + 1)$;  if wind blows the direction D, then the ship moves from $(x, y)$ to $(x, y - 1)$;  if wind blows the direction L, then the ship moves from $(x, y)$ to $(x - 1, y)$;  if wind blows the direction R, then the ship moves from $(x, y)$ to $(x + 1, y)$. 

The ship can also either go one of the four directions or stay in place each day. If it goes then it's exactly 1 unit of distance. Transpositions of the ship and the wind add up. If the ship stays in place, then only the direction of wind counts. For example, if wind blows the direction U and the ship moves the direction L, then from point $(x, y)$ it will move to the point $(x - 1, y + 1)$, and if it goes the direction U, then it will move to the point $(x, y + 2)$.

You task is to determine the minimal number of days required for the ship to reach the point $(x_2, y_2)$.


-----Input-----

The first line contains two integers $x_1, y_1$ ($0 \le x_1, y_1 \le 10^9$) — the initial coordinates of the ship.

The second line contains two integers $x_2, y_2$ ($0 \le x_2, y_2 \le 10^9$) — the coordinates of the destination point.

It is guaranteed that the initial coordinates and destination point coordinates are different.

The third line contains a single integer $n$ ($1 \le n \le 10^5$) — the length of the string $s$.

The fourth line contains the string $s$ itself, consisting only of letters U, D, L and R.


-----Output-----

The only line should contain the minimal number of days required for the ship to reach the point $(x_2, y_2)$.

If it's impossible then print "-1".


-----Examples-----
Input
0 0
4 6
3
UUU

Output
5

Input
0 3
0 0
3
UDD

Output
3

Input
0 0
0 1
1
L

Output
-1



-----Note-----

In the first example the ship should perform the following sequence of moves: "RRRRU". Then its coordinates will change accordingly: $(0, 0)$ $\rightarrow$ $(1, 1)$ $\rightarrow$ $(2, 2)$ $\rightarrow$ $(3, 3)$ $\rightarrow$ $(4, 4)$ $\rightarrow$ $(4, 6)$.

In the second example the ship should perform the following sequence of moves: "DD" (the third day it should stay in place). Then its coordinates will change accordingly: $(0, 3)$ $\rightarrow$ $(0, 3)$ $\rightarrow$ $(0, 1)$ $\rightarrow$ $(0, 0)$.

In the third example the ship can never reach the point $(0, 1)$.

Difficulty: interview

Starter code:

Solutions:
x1, y1 = map(int, input().split())
x2, y2 = map(int, input().split())
n = int(input())
s = input()
psx = [0 for i in range(n)]
psy = [0 for i in range(n)]

if s[0] == 'L':
    psx[0] = -1
elif s[0] == 'R':
    psx[0] = +1

if s[0] == 'D':
    psy[0] = -1
elif s[0] == 'U':
    psy[0] = +1

for i in range(1, n):
    psx[i] = psx[i-1]
    psy[i] = psy[i-1]
    
    if s[i] == 'L':
        psx[i] += -1
    elif s[i] == 'R':
        psx[i] += +1
    
    if s[i] == 'D':
        psy[i] += -1
    elif s[i] == 'U':
        psy[i] += +1

def valid(step):
    cycle = step // n
    rem = step % n
    x = x1
    y = y1
    x += psx[n-1] * cycle
    y += psy[n-1] * cycle
    if rem > 0:
        x += psx[rem-1]
        y += psy[rem-1]
    ManhattanDistance = abs(x - x2) + abs(y - y2)
    return (ManhattanDistance <= step)
    
def binsearch(top, bot):
    res = -1
    while top <= bot:
        mid = (top + bot) // 2
        if valid(mid):
            res = mid
            bot = mid - 1
        else:
            top = mid + 1
    return res
    

print(binsearch(0, 1000000000000000000))

x1, y1 = list(map(int, input().split()))
x2, y2 = list(map(int, input().split()))
n = int(input())
s = input()

x, y = x2-x1, y2-y1
X = [[0,0] for i in range(n+1)]
for i in range(n):
    if s[i] == "U":
        X[i+1] = [X[i][0], X[i][1]+1]
    elif s[i] == "D":
        X[i+1] = [X[i][0], X[i][1]-1]
    elif s[i] == "L":
        X[i+1] = [X[i][0]-1, X[i][1]]
    elif s[i] == "R":
        X[i+1] = [X[i][0]+1, X[i][1]]


def chk(k):
    nonlocal x, y
    # print("chk", k)
    for i in range(n):
        xt = X[i][0]
        yt = X[i][1]
        if abs(xt+X[n][0]*k-x) + abs(yt+X[n][1]*k-y) <= k*n+i:
            # print(k, n, i, k*n+i)
            return k*n+i
        
    return -1

def chklr(l, r, ma):
    if l+1 == r:
        return ma
    m = (l+r) // 2
    tmp = chk(m)
    if tmp < 0:
        return chklr(m, r, ma)
    else:
        return chklr(l, m, tmp)
    
# print(X)

if chk(10**15) < 0:
    print(-1)
else:
    print(chklr(-1, 10**15, chk(10**15)))


x1, y1 = map(int, input().split())
x2, y2 = map(int, input().split())
n = int(input())
s = list(input())
p = [(0, 0)]
for i in range(n):
    if s[i] == 'U': p.append((p[-1][0], p[-1][1]+1))
    elif s[i] == 'D': p.append((p[-1][0], p[-1][1]-1))
    elif s[i] == 'R': p.append((p[-1][0]+1, p[-1][1]))
    else: p.append((p[-1][0]-1, p[-1][1]))

def check(m):
    dx, dy = p[-1][0]*(m//n) + p[m%n][0], p[-1][1]*(m//n) + p[m%n][1]
    if abs(x1+dx-x2) + abs(y1+dy-y2) <= m:
        return True
    else:
        return False

def outer(k):
    l = 0
    h = 10**10
    ans = -1
    while l <= h:
        m = (l+h)//2
        if check(n*m+k):
            ans = n*m+k
            h = m-1
        else:
            l = m+1
    return ans
    
a = None
for i in range(n):
    ta = outer(i)
    if ta != -1:
        if a is None:
            a = ta
        else:
            a = min(a, ta)
if a is None: print(-1)
else: print(a)

x1,y1=list(map(int,input().split()))
x2,y2=list(map(int,input().split()))
x2-=x1
y2-=y1
x1=0
y1=0
n=int(input())
a=list(input())
r=[0,0]
flag=True
for i in range(n):
    if a[i]=='U':
        r[1]+=1
    if a[i]=='D':
        r[1]-=1
    if a[i]=='L':
        r[0]-=1
    if a[i]=='R':
        r[0]+=1
left=0
right=90000000000
for i in range(2*(10**10)):
    r1=r[:]
    r1[0]*=((left+right)//2)
    r1[1]*=((left+right)//2)
    if abs(r1[0]-x2)+abs(r1[1]-y2)<=((left+right)//2)*n:
        right=((left+right)//2)
    else:
        left=((left+right)//2)
    if right==90000000000 and left==90000000000-1:
        flag=False
    if left+1==right:
        break
rl=r[:]
rl[0]*=left
rl[1]*=left
if flag:
    for i in range(n):
        if a[i]=='U':
            rl[1]+=1
        if a[i]=='D':
            rl[1]-=1
        if a[i]=='L':
            rl[0]-=1
        if a[i]=='R':
            rl[0]+=1
        if abs(rl[0]-x2)+abs(rl[1]-y2)<=left*n+i+1:
            print(left*n+i+1)
            break
else:
    print(-1)


def is_possible(num_days):
    if num_days % len(string) == 0:
        diff_wind = ((num_days // len(string)) * pref[-1][0],(num_days // len(string)) * pref[-1][1])
    else:
        diff_wind = ((num_days // len(string)) * pref[-1][0] + pref[num_days % len(string) - 1][0],(num_days // len(string)) * pref[-1][1] + pref[num_days % len(string) - 1][1])
    diff_ship = ((diff[0] - diff_wind[0],diff[1] - diff_wind[1]))
    #print(diff_ship)
    return abs(diff_ship[0]) + abs(diff_ship[1]) <= num_days
x,y = [int(s) for s in input().split()]
x1,y1 = [int(s) for s in input().split()]
diff = ((x1 - x,y1 - y))
amount = int(input())
string = input()
motions = []
pref = [] 
for i in range(len(string)):
    if string[i] == 'U':
        motions.append((0,1))
    if string[i] == 'D':
        motions.append((0, -1))
    if string[i] == 'R':
        motions.append((1,0))
    if string[i] == 'L':
        motions.append((-1,0))
#print(motions)
pref.append(motions[0])
#print(pref)
for i in range(1, len(motions)):
    pref.append((motions[i][0] + pref[-1][0],motions[i][1] + pref[-1][1]))
#print(pref)
left = -1
right = int(10e18)
#print(is_possible(6))
while right - left > 1:
    middle = (right + left) // 2
    if is_possible(middle):
        right = middle
    else:
        left = middle
if right != int(10e18):
    print(right)
else:
    print(-1)

from collections import Counter
x1, y1 = list(map(int, input().split()))
x2, y2 = list(map(int, input().split()))
x = x1 - x2
y = y1 - y2
xpy = x + y
p2 = (abs(xpy) - 1) // 2
xmy = x - y
m2 = (abs(xmy) - 1) // 2
n = int(input())
s = input().lower()
c = Counter(s)
dr = c['d'] + c['r']
ld = c['l'] + c['d']
lu = c['l'] + c['u']
ru = c['r'] + c['u']


def f(a, b, d, e):
    return a and b // (d if a < 0 else e)


try:
    res = max(f(xpy, p2, ru, ld), f(xmy, m2, dr, lu))
except ZeroDivisionError:
    print('-1')
else:
    dr *= res
    ld *= res
    lu *= res
    ru *= res
    res *= n


    def g(a, b, d, e):
        return a == 0 or (b if a < 0 else d) > e


    for c in s:
        res += 1
        if c in 'dr':
            dr += 1
        if c in 'ld':
            ld += 1
        if c in 'lu':
            lu += 1
        if c in 'ru':
            ru += 1
        if g(xpy, ru, ld, p2) and g(xmy, dr, lu, m2):
            break
    print(res)


In = input().split(' ')
x1 = int(In[0])
y1 = int(In[1])
In = input().split(' ')
x2 = int(In[0])
y2 = int(In[1])
dx = [0]
dy = [0]
n = int(input())
s = input()
for i in range(1, n + 1):
    dx.append(dx[i - 1])
    dy.append(dy[i - 1])
    if s[i - 1] == 'U':
        dy[i] += 1
    elif s[i - 1] == 'D':
        dy[i] -= 1
    elif s[i - 1] == 'R':
        dx[i] += 1
    elif s[i - 1] == 'L':
        dx[i] -= 1
st = 0
en = (10 ** 18) * 2
ans = -1
while st <= en:
    mid = (st + en) // 2
    x = (mid // n) * dx[n] + dx[mid % n]
    y = (mid // n) * dy[n] + dy[mid % n]
    newX = x + x1
    newY = y + y1
    need = abs(newX - x2) + abs(newY - y2)
    if mid >= need:
        ans = mid
        en = mid - 1
    else:
        st = mid + 1
print(ans)


import sys
x1,y1 = list(map(int,input().split()))
x2,y2 = list(map(int,input().split()))
n = int(input())
s = input()

us = s.count('U')
ds = s.count('D')
ls = s.count('L')
rs = s.count('R')


rlswap = False
udswap = False
if x2 < x1:
    # L <-> R
    rlswap = True
    ls,rs = rs,ls
if y2 < y1:
    # D -> U
    udswap = True
    us,ds = ds,us
# We're going top right

dx = abs(x1-x2)
dy = abs(y1-y2)
#if ds == n or ls == n:
#    print(-1)
#    return

def dist(x1,y1,x2,y2):
    return abs(x1-x2) + abs(y1-y2)

wx = rs - ls
wy = us - ds

dstart = dist(0,0,dx,dy)
dawind = dist(wx,wy,dx,dy)

free = n

l=0
r=(dx+dy+1)*n
while r-l > 1:
    t = (l+r)//2
    if dist(*(wx*t, wy*t), dx,dy) > free*t:
        l = t
    else:
        r = t

t = l
t = max(0, t-1)
count = n*t

x = wx*t
y = wy*t
free = free*t

for c in s*10:
    if dist(x,y,dx,dy) <= free:
        break
    if c in 'RL' and rlswap:
        c = 'RL'[c=='R']
    if c in 'UD' and udswap:
        c = 'UD'[c=='U']

    if c == 'U':
        y += 1
    if c == 'D':
        y -= 1
    if c == 'L':
        x -= 1
    if c == 'R':
        x += 1

    free += 1
    count += 1
else:
    print(-1)
    return

print(count)


x1,y1 = list(map(int, input().split()))
x2,y2 = list(map(int, input().split()))

n = int(input())
s = input()

def dst(x1,y1,x2,y2):
    return abs(x2-x1) + abs(y2-y1)

d = dst(x1,y1,x2,y2)

dx=dy=0
ss = []
for i in range(n):
    if s[i] == 'U':
        dy += 1
    elif s[i] == 'D':
        dy -= 1
    elif s[i] == 'R':
        dx += 1
    else:
        dx -=1
    ss.append((dx, dy))

l = 1
r = 10**18

def check(m):
    c = m // n
    x = x1 + dx*c
    y = y1 + dy*c
    r = m % n
    if r != 0:
        x += ss[r-1][0]
        y += ss[r-1][1]
    d = dst(x2,y2,x,y)
    if d <= m:
        return True
    return False

ans = 10**19
while r >= l:
    m = int((r+l) // 2)
    if check(m):
        ans = min(ans, m)
        r = m - 1
    else:
        l = m + 1

if ans == 10**19:
    print(-1)
else:
    print(ans)






#from bisect import bisect_left

rose = {
    'U': (0, 1),
    'D': (0, -1),
    'L': (-1, 0),
    'R': (1, 0),
}


class Solution:
    def __init__(self):
        self.wind_cost = one_cycle()
        self.wind_len = len(wind)

    def calc(self, days):
        ncycles = days // self.wind_len
        wind_x = x1 + ncycles * self.wind_cost[0]
        wind_y = y1 + ncycles * self.wind_cost[1]
        wind_x, wind_y = rest([wind_x, wind_y], days % self.wind_len)
        return abs(wind_x - x2) + abs(wind_y - y2)

    def __getitem__(self, days):
        return self.calc(days) <= days


def one_cycle():
    p = [0, 0]
    for w in wind:
        p[0] += rose[w][0]
        p[1] += rose[w][1]
    return p


def rest(p, k):
    for i in range(k):
        p[0] += rose[wind[i]][0]
        p[1] += rose[wind[i]][1]
    return p


def bisect_left(a, x, lo=0, hi=None):
    """Return the index where to insert item x in list a, assuming a is sorted.

    The return value i is such that all e in a[:i] have e < x, and all e in
    a[i:] have e >= x.  So if x already appears in the list, a.insert(x) will
    insert just before the leftmost x already there.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    """

    if lo < 0:
        raise ValueError('lo must be non-negative')
    if hi is None:
        hi = len(a)
    while lo < hi:
        mid = (lo+hi)//2
        if a[mid] < x:
            lo = mid+1
        else:
            hi = mid
    return lo


x1, y1 = list(map(int, input().split()))
x2, y2 = list(map(int, input().split()))
n = int(input())
wind = input()

k = bisect_left(Solution(), 1, 0, 100000000000000000)
if k == 100000000000000000:
    k = -1
print(k)


x1,y1 = [int(i) for i in input().split()]
x2,y2 = [int(i) for i in input().split()]

n = int(input())
s = input()

def dst(x1,y1,x2,y2):
    return abs(x2-x1) + abs(y2-y1)

d = dst(x1,y1,x2,y2)

dx=dy=0
ss = []
for i in range(n):
    if s[i] == 'U':
        dy += 1
    elif s[i] == 'D':
        dy -= 1
    elif s[i] == 'R':
        dx += 1
    else:
        dx -=1
    ss.append((dx, dy))

l = 1
r = 10**18

def check(m):
    c = m // n
    x = x1 + dx*c
    y = y1 + dy*c
    r = m % n
    if r != 0:
        x += ss[r-1][0]
        y += ss[r-1][1]
    d = dst(x2,y2,x,y)
    if d <= m:
        return True
    return False

ans = 10**19
while r >= l:
    m = int((r+l) // 2)
    if check(m):
        ans = min(ans, m)
        r = m - 1
    else:
        l = m + 1

if ans == 10**19:
    print(-1)
else:
    print(ans)

# -*- coding: utf-8 -*-
"""
Created on Mon Feb 18 21:05:51 2019

@author: HP
"""

x1,y1 = map(int,input().split())
xx,yy = map(int,input().split())
n=int(input())
x=0
y=0
s=input()
for i in s:
    if i is 'R':
        x+=1
    elif i is 'L':
        x-=1
    elif i is 'U':
        y+=1
    else:
        y-=1
start = 0
end = 10**18
while start<end:
    mid = (start+end)//2
    div = mid//n
    rem = mid%n
    currx = div*x
    curry = div*y
    for i in range(rem):
        if s[i] is 'R':
            currx+=1
        elif s[i] is 'L':
            currx-=1
        elif s[i] is 'U':
            curry+=1
        else:
            curry-=1
    currx = currx + x1
    curry = curry + y1
    dis = abs(currx-xx)+abs(curry-yy)
    if dis<=mid:
        end = mid
    else:
        start = mid+1

if start>=10**18:
    print(-1)
else:
    print(start)

inp = lambda: list(map(int, input().split()))
x1, y1 = inp()
x2, y2 = inp()
n, = inp()
W = list(input())

class Point:
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def __add__(self, other):
        return Point(self.x + other.x, self.y + other.y)

    def __mul__(self, other):
        return Point(self.x * other, self.y * other)

    def __str__(self):
    	return f'({self.x},{self.y})'
    
    def manD(self, other):
        return abs(self.x - other.x) + abs(self.y - other.y)
        
u = Point(x1, y1)
v = Point(x2, y2)

d = {
    'L': Point(-1, 0),
    'R': Point(+1, 0),
    'U': Point(0, +1),
    'D': Point(0, -1),
}

W = [d[x] for x in W]

def sum(W, n=None):
	if n == None:
		n = len(W)
	pos = Point(0, 0)
	for i in range(n):
		pos += W[i]
	return pos

def check(days):
    pos = u + sum(W)*int(days/n) + sum(W, days%n)
    dist = pos.manD(v)
    if dist <= days:
        return True
    return False

l = 1
r = 10**16
while r - l > 1:
    mid = int((l + r)/2)
    if check(mid):
        r = mid
    else:
        l = mid + 1
res = -1
if check(l):
    res = l
elif check(r):
    res = r
print(res)

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
"""

from collections import Counter

x1, y1 = list(map(int, input().split()))
x2, y2 = list(map(int, input().split()))
xx = x2-x1
yy = y2-y1
n = int(input())
s = list(input())


pxli = [0]
pyli = [0]
tmpx = 0
tmpy = 0
for ll in s:
    if ll == 'U':
        tmpy += 1
    if ll == 'D':
        tmpy -= 1
    elif ll == 'R':
        tmpx += 1
    elif ll == 'L':
        tmpx -= 1
    pxli.append(tmpx)
    pyli.append(tmpy)

dx = pxli[-1]
dy = pyli[-1]


def isreachable(x, y, d, divmod=divmod):
    cyc, m = divmod(d, n)
    ddx = dx*cyc + pxli[m]
    ddy = dy*cyc + pyli[m]
    return abs(x-ddx)+abs(y-ddy) <= d


if not isreachable(xx, yy, 10**17):
    print(-1)
    return

db = 10**17
ds = 0
while db-ds > 1:
    dm = (db+ds)//2
    if isreachable(xx, yy, dm):
        db = dm
    else:
        ds = dm

if isreachable(xx, yy, ds):
    print(ds)
else:
    print(ds+1)



#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
"""

from collections import Counter
from itertools import accumulate
from itertools import chain

x1, y1 = list(map(int, input().split()))
x2, y2 = list(map(int, input().split()))
xx = x2-x1
yy = y2-y1
n = int(input())
s = list(input())

letterdict = {'U': (0, 1), 'D': (0, -1), 'L': (-1, 0), 'R': (1, 0)}
pxli = list(chain(iter([0]), accumulate([letterdict[ll][0] for ll in s])))
pyli = list(chain(iter([0]), accumulate([letterdict[ll][1] for ll in s])))

dx = pxli[-1]
dy = pyli[-1]


def isreachable(x, y, d, divmod=divmod):
    cyc, m = divmod(d, n)
    ddx = dx*cyc + pxli[m]
    ddy = dy*cyc + pyli[m]
    return abs(x-ddx)+abs(y-ddy) <= d


if not isreachable(xx, yy, 10**17):
    print(-1)
    return

db = 10**17
ds = 0
while db-ds > 1:
    dm = (db+ds)//2
    if isreachable(xx, yy, dm):
        db = dm
    else:
        ds = dm

if isreachable(xx, yy, ds):
    print(ds)
else:
    print(ds+1)



x1, y1 = map(int, input().split())
x2, y2 = map(int, input().split())
n = int(input())
s = input()
X, Y = 0, 0
for c in s:
    if c in 'UD':
        Y += 1 if c == 'U' else -1
    else:
        X += 1 if c == 'R' else -1

lo = 0
hi = 2*10**9+10
ans = -1
while lo <= hi:
    curr = -1
    mid = (lo+hi)//2
    cx, cy = x1, y1
    for i in range(n):
        dx = abs(x2-X*mid-cx)
        dy = abs(y2-Y*mid-cy)
        if dx+dy <= mid*n+i:
            val = mid*n+i
            curr = val if curr == -1 or curr > val else curr
        if s[i] in 'UD':
            cy += 1 if s[i] == 'U' else -1
        else:
            cx += 1 if s[i] == 'R' else -1
    if curr != -1:
        ans = curr if ans == -1 or ans > curr else ans
        hi = mid-1
    else:
        lo = mid+1
print(ans)

def valid(num):
	x2 = x0+disx[n] * (num//n) + disx[num%n]
	y2 = y0+disy[n] * (num//n) + disy[num%n]
	distance = abs(x2-x1)+abs(y2-y1);
	return (distance <=num)

def binsearch(L,R):
	ans = -1;
	while L <= R:
		mid = (L+R)//2
		if valid(mid):
			ans = mid
			R = mid-1
		else:
			L = mid+1
	return ans
x0,y0 = list(map(int,input().split()))
x1,y1 = list(map(int,input().split()))
n = int(input())
s = input()
disx = [0 for i in range(n+1)]
disy = [0 for i in range(n+1)]
for i in range(n):
	disx[i+1] = disx[i]
	disy[i+1] = disy[i]
	if s[i] == 'L':
		disx[i+1] -=1
	elif s[i] == 'R':
		disx[i+1] +=1
	elif s[i] == 'U':
		disy[i+1] +=1
	elif s[i] == 'D':
		disy[i+1] -=1
print(binsearch(0,1000000000000000))




a,b = list(map(int,input().split()))
c,d = list(map(int,input().split()))
n = int(input())
s = input()

janax = [0]*n
janay = [0]*n

if s[0] == 'L':
    janax[0] = -1
elif s[0] == 'R':
    janax[0] = 1

if s[0] == 'D':
    janay[0] = -1
elif s[0] == 'U':
    janay[0] = 1

for i in range(1,n):
    janax[i] = janax[i-1]
    janay[i] = janay[i-1]

    if s[i] == 'L':
        janax[i] += -1
    elif s[i] == 'R':
        janax[i] += 1

    if s[i] == 'D':
        janay[i] += -1
    elif s[i] == 'U':
        janay[i] += 1

def aayenge(duri):
    kitni_baar = duri // n
    kitna_bacha = duri % n

    x = a
    y = b

    x += janax[n-1]*kitni_baar
    y += janay[n-1]*kitni_baar

    if kitna_bacha > 0:
        x += janax[kitna_bacha-1]
        y += janay[kitna_bacha-1]

    return (abs(x-c) + abs(y-d)) <= duri


def lagadiya(left , right):
    ans = -1
    while left <= right:
        mid = (left+right)//2
        if aayenge(mid):
            ans = mid
            right = mid - 1
        else:
            left = mid + 1
    return ans

print(lagadiya(0,10**18))



x1, y1 = [int(x) for x in input().split()]
x2, y2 = [int(x) for x in input().split()]
lens=int(input())
string=input()
x = [0 for _ in range(lens + 1)]
y = [0 for _ in range(lens + 1)]
for i in range(lens):
    x[i + 1] = x[i] + (string[i] == "R") - (string[i] == "L")
    y[i + 1] = y[i] + (string[i] == "U") - (string[i] == "D")
    

left = -1
rite = int(10 ** 18)
ans = int(10 ** 18) + 1
while rite - left > 1:
    mid = (left + rite) >> 1
    X = (mid // lens) * x[-1] + x[mid % lens]
    Y = y[-1] * (mid // lens) + y[mid % lens]
    X += x1
    Y += y1
    if abs(X - x2) + abs(Y - y2) <= mid: rite = mid
    else: left = mid
        
print([rite, -1][rite == 10 ** 18])        
    
     
    



def valid(num):
	x2 = x0+disx[n] * (num//n) + disx[num%n]
	y2 = y0+disy[n] * (num//n) + disy[num%n]
	distance = abs(x2-x1)+abs(y2-y1)
	return (distance <=num)

def binsearch(L,R):
	ans = -1;
	while L <= R:
		mid = (L+R)//2
		if valid(mid):
			ans = mid
			R = mid-1
		else:
			L = mid+1 
	return ans
x0,y0 = list(map(int,input().split()))
x1,y1 = list(map(int,input().split()))
n = int(input())
s = input()
disx = [0 for i in range(n+1)]
disy = [0 for i in range(n+1)]
for i in range(n):
	disx[i+1] = disx[i]
	disy[i+1] = disy[i]
	if s[i] == 'L':
		disx[i+1] -=1
	elif s[i] == 'R':
		disx[i+1] +=1
	elif s[i] == 'U':
		disy[i+1] +=1
	elif s[i] == 'D':
		disy[i+1] -=1
print(binsearch(0,1000000000000000))


def check(k,n,dx,dy):
	x = (k//n)*px[n]
	y = (k//n)*py[n]
	x += px[k%n]
	y += py[k%n]
	if abs(x-dx)+abs(y-dy)<=k:
		return 1
	return 0
x1,y1=list(map(int,input().split()))
x2,y2=list(map(int,input().split()))
dx = x2-x1
dy = y2-y1
n=int(input())
s=input()
px=[0]*(n+5)
py = [0]*(n+5)
for i in range(1,n+1):
	px[i] = px[i-1]
	py[i] = py[i-1]
	if s[i-1]=='U':
		py[i]+=1
	elif s[i-1]=='D':
		py[i]-=1
	elif s[i-1]=='L':
		px[i]-=1
	else:
		px[i]+=1
	

s=0
e = int(10**18)
ans  = -1

while s<=e:
	m = (s+e)//2
	if check(m,n,dx,dy):
		ans = m
		e = m-1
	else:
		s = m+1
print(ans)


x1,y1=list(map(int,input().split()))
x2,y2=list(map(int,input().split()))
n=int(input())
S=input()

xw=0
yw=0
WALKLIST=[(0,0)]
for s in S:
    if s=="U":
        yw+=1
    elif s=="D":
        yw-=1
    elif s=="L":
        xw-=1
    elif s=="R":
        xw+=1
    WALKLIST.append((xw,yw))

MIN=0
MAX=10**15

while MIN!=MAX:
    x=(MIN+MAX)//2

    r,d=divmod(x,n)
    if abs(x2-(x1+r*xw+WALKLIST[d][0]))+abs(y2-(y1+r*yw+WALKLIST[d][1]))<=x:
        MAX=x
    else:
        MIN=x+1

    if MIN==10**15:
        print(-1)
        break
else:
    print(MAX)
        


import sys

x0, y0 = list(map(int, input().split(' ')))
x1, y1 = list(map(int, input().split(' ')))
n = int(input())
s = input()
l = 0
r = 10**18

d = [[0, 0]]
dx = 0
dy = 0

for lv in s:
    if lv == 'R':
        dx += 1
    elif lv == 'L':
        dx -= 1
    elif lv == 'U':
        dy += 1
    else:
        dy -= 1
    d.append((dx, dy))


def check(x1, y1, x2, y2, t) -> bool:
    x_wind = d[-1][0] * (t // n)
    x_wind += d[t % n][0]
    y_wind = d[-1][1] * (t // n)
    y_wind += d[t % n][1]
    return abs(x1 + x_wind - x2) + abs(y_wind + y1 - y2) <= t


mid = 0
max_mid = -1
while l <= r:
    mid = (l + r) // 2
    if check(x0, y0, x1, y1, mid):
        r = mid - 1
        max_mid = mid
    else:
        l = mid + 1

if check(x0, y0, x1, y1, max_mid):
    print(max_mid)
else:
    print(-1)


def check(v, length, start, target):
    n     = len(v)
    end_x = start[0] + int(length / n) * v[-1][0]   
    end_y = start[1] + int(length / n) * v[-1][1] 
    
    if length % n != 0: 
        end_x += v[length % n -1][0]
        end_y += v[length % n -1][1]
    
    if abs(target[0]-end_x) + abs(target[1]-end_y) <= length:
        return True
    return False

start  = list(map(int, input().split())) #[0, 7] 
end    = list(map(int, input().split())) #[103080, -3000000] 
n      = int(input()) 
seed   = input()                         #'LUDRUDRL'

v    =  []
dx   = {'R':1,'L':-1,'U':0,'D':0} 
dy   = {'R':0,'L':0,'U':1,'D':-1}

cur  = [0, 0] 
for c in seed:
    cur = [cur[0]+dx[c], cur[1]+dy[c]]
    v.append(cur)
#print(v)

inf = 1 << 64
l   = 0
u   = inf

while(u-l>1):
    md = int((l+u) / 2)
    if check(v, md, start, end):
        u = md
    else:
        l = md
        
if u!= inf:
    print(u)
else:
    print(-1)