#include <bits/stdc++.h>

#pragma GCC optimize("O3", "unroll-all-loops")
#pragma GCC target("avx2")

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;

ifstream in;
ofstream out;

const long long kk = 1000;
const long long ml = kk * kk;
const long long mod = ml * kk + 7;
const long long inf = ml * ml * ml + 7;
const ld eps = 1e-7;

ll n, con;
vector<ld> mx, mn, sum;
bool viv = false;

ld read() {
    string s;
    cin >> s;
    if (s.size() == 1 || s[0] == '1') return s[0] - '0';
    s.erase(s.begin());
    s.erase(s.begin());
    s.resize(9, '0');
    ld ans = atoi(s.c_str());
    ans /= 1e9;
    return ans;
}

pld root(ld sa, ld sab, ld s, ld mx) {
//    ld sb = sab - sa;
    ld b = 2*sa - sab - s;
    ld c = mx - s * sa;
    cout.precision(20);
    ld d = sqrtl(max((ld)0, b * b - 4 * c));
//    ld d = sqrtl(max((ld)0, (sa - sb - s) * (sa - sb - s) - 4 * (mx - s * sa)));
    pld rs = {(- b + d) / 2, 0};
//    pld rs = {(- b + sqrtl(max((ld)0, (sa - sb - s) * (sa - sb - s) - 4 * (mx - s * sa)))) / 2, 0};
    rs.S = -b - rs.F;
    if (abs(rs.F) < eps)
        rs.F = 0;
    if (abs(rs.S) < eps)
        rs.S = 0;
    if (abs(rs.F - s) < eps)
        rs.F = s;
    if (abs(rs.S - s) < eps)
        rs.S = s;
    return rs;
}

void prepare() {
    sum = mn;
    for (ll i = 0; i < n; i++)
        sum[i] += mx[i];

    vector<ld> pref;
    pref.push_back(0);
    for (ll i = 0; i < n; i++)
        pref.push_back(pref.back() + sum[i]);

    ld suma = 0;
    vector<ld> a, b;
    for (ll i = 0; i < n; i++) {
        pld add = root(suma, pref[i], sum[i], mx[i]);
//        cout << add.F << ' ' << add.S << endl;
        if (viv)
            cout << "__ " << add.F << ' ' << add.S << endl;
        a.push_back(add.F);
        suma += a.back();
        if (a.back() < 0 || sum[i] - a.back() < 0) {
            suma -= a.back();
            a.pop_back();
            a.push_back(add.S);
            suma += a.back();
        }
        if (a.back() < 0 || sum[i] - a.back() < 0) {
            suma -= a.back();
            a.pop_back();
            a.push_back(0);
            suma += a.back();
        }
    }
    cout.precision(6);
    for (ll i = 0; i < n; i++)
        cout << fixed << a[i]<< ' ';
    cout << endl;
    for (ll i = 0; i < n; i++)
        cout << fixed << sum[i] - a[i] << ' ';
    cout << endl;
}

int main() {
//    freopen("ex.txt", "r", stdin);
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    for (ll i = 0; i < n; i++)
        mx.push_back(read());
    for (ll i = 0; i < n; i++)
        mn.push_back(read());
    prepare();

    return 0;
}
/**
10
0.10 0.02 0.04 0.69 0.01 0.01 0.06 0.02 0.03 0.02
1 0 0 0 0 0 0 0 0 0

3
0.07 0.2 0.73
0.73 0.2 0.07

3
0.02 0.22 0.76
0.28 0.58 0.14

6
0.001 0.0035 0.3843 0.11 0.1837 0.3175
0.109 0.0665 0.6957 0.07 0.0363 0.0225

10
0.00022404 0.00074752 0.00196930 0.00393592 0.00255606 0.00436464 0.00217638 0.00245083 0.00950300 0.97207230
0.03596096 0.02540748 0.04472470 0.05320308 0.02658194 0.03841636 0.01653562 0.01777117 0.05187200 0.68952670

**/


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const int MX = 100005;

double A[MX], B[MX];

double x[MX], y[MX];

int main()
{
	int n;
	ignore = scanf("%d", &n);

	for (int i = 1; i <= n; i++) {
		ignore = scanf("%lf", A + i);
		A[i] += A[i - 1];
	}

	for (int i = 1; i <= n; i++) {
		ignore = scanf("%lf", B + i);
	}
	for (int i = n; i >= 1; i--) {
		B[i] += B[i + 1];
	}

	for (int i = 1; i <= n; i++) {
		double a = A[i];
		double b = 1.0 + A[i] - B[i + 1];

		double D = b*b - 4.0*a;
		if (D < 1e-18) D = 1e-18;
		D = sqrt(D);

		x[i] = (b - D) / 2.0;
		y[i] = (b + D) / 2.0;
	}

	for (int i = 1; i <= n; i++) {
		printf("%.15lf ", x[i] - x[i - 1]);
	}
	printf("\n");
	for (int i = 1; i <= n; i++) {
		printf("%.15lf ", y[i] - y[i - 1]);
	}
	printf("\n");
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const int MX = 100005;

double A[MX], B[MX];

double x[MX], y[MX];

int main()
{
	int n;
	ignore = scanf("%d", &n);

	for (int i = 1; i <= n; i++) {
		ignore = scanf("%lf", A + i);
		A[i] += A[i - 1];
	}

	for (int i = 1; i <= n; i++) {
		ignore = scanf("%lf", B + i);
	}
	for (int i = n; i >= 1; i--) {
		B[i] += B[i + 1];
	}

	for (int i = 1; i <= n; i++) {
		double a = A[i];
		double b = 1.0 + A[i] - B[i + 1];

		double D = sqrt(b*b - 4.0*a);

		x[i] = (b - D) / 2.0;
		y[i] = (b + D) / 2.0;
	}

	for (int i = 1; i <= n; i++) {
		printf("%.15lf ", x[i] - x[i - 1]);
	}
	printf("\n");
	for (int i = 1; i <= n; i++) {
		printf("%.15lf ", y[i] - y[i - 1]);
	}
	printf("\n");
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const int MX = 100005;

double A[MX], B[MX];

double x[MX], y[MX];

int main()
{
	int n;
	ignore = scanf("%d", &n);

	for (int i = 1; i <= n; i++) {
		ignore = scanf("%lf", A + i);
		A[i] += A[i - 1];
	}

	for (int i = 1; i <= n; i++) {
		ignore = scanf("%lf", B + i);
	}
	for (int i = n; i >= 1; i--) {
		B[i] += B[i + 1];
	}

	for (int i = 1; i <= n; i++) {
		double a = A[i];
		double b = 1.0 + A[i] - B[i + 1];

		double D = sqrt(b*b - 4.0*a);

		x[i] = (b - D) / 2.0;
		y[i] = (b + D) / 2.0;
	}

	for (int i = 1; i <= n; i++) {
		printf("%lf ", x[i] - x[i - 1]);
	}
	printf("\n");
	for (int i = 1; i <= n; i++) {
		printf("%lf ", y[i] - y[i - 1]);
	}
	printf("\n");
}


#define _USE_MATH_DEFINES

#include <bits/stdc++.h>

using namespace std;

typedef long double ld;
typedef double db;
typedef long long ll;

#define int long long
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define sz(a) (signed)a.size()

const int INF = 1e18;
const ld EPS = 1e-9;

ld kukarek(ld kek) {
	if (kek < 0) {
		kek = 0;
	}
	if (kek > 1) {
		kek = 1;
	}
	return kek;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    ld s1[n], s2[n];
    for (int i = 0; i < n; i++) {
    	cin >> s1[i];
    }
    for (int i = 0; i < n; i++) {
    	cin >> s2[i];
    }
    ld p[n], q[n];
    ld a = 0, b = 0;
    bool fl = false;
    for (int i = 0; i < n; i++) {
    	ld D = (s1[i] + s2[i] + a - b) * (s1[i] + s2[i] + a - b) + 4 * (b * s1[i] + b * s2[i] - s1[i]);
    	ld x1 = (a - b + s1[i] + s2[i] + sqrt(D + EPS * EPS)) / 2.0;
    	ld x2 = (a - b + s1[i] + s2[i] - sqrt(D + EPS * EPS)) / 2.0;
    	p[i] = x2;
    	q[i] = s1[i] + s2[i] - p[i];
    	if (p[i] - q[i] < EPS && p[i] - q[i] > -EPS) {
    		fl = true;
    	}
    	if (fl) {
    		p[i] = x1;
    		q[i] = s1[i] + s2[i] - p[i];
    	}
    	a += q[i];
    	b += p[i];
    	p[i] = kukarek(p[i]);
    	q[i] = kukarek(q[i]);
    }
    p[n - 1] = q[n - 1] = 1;
    for (int i = 0; i < n - 1; i++) {
    	p[n - 1] -= p[i];
    	q[n - 1] -= q[i];
    }
    for (int i = 0; i < n; i++) {
    	cout << setprecision(30) << p[i] << ' ';
    }
    cout << endl;
    for (int i = 0; i < n; i++) {
    	cout << setprecision(30) << q[i] << ' ';
    }
    return 0;
}


#define _USE_MATH_DEFINES

#include <bits/stdc++.h>

using namespace std;

typedef long double ld;
typedef double db;
typedef long long ll;

#define int long long
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define sz(a) (signed)a.size()

const int INF = 1e18;
const ld EPS = 1e-14;

ld kukarek(ld kek) {
	if (kek < 0) {
		kek = 0;
	}
	if (kek > 1) {
		kek = 1;
	}
	return kek;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    ld s1[n], s2[n];
    for (int i = 0; i < n; i++) {
    	cin >> s1[i];
    }
    for (int i = 0; i < n; i++) {
    	cin >> s2[i];
    }
    ld p[n], q[n];
    ld a = 0, b = 0;
    bool fl = false;
    for (int i = 0; i < n; i++) {
    	ld D = (s1[i] + s2[i] + a - b) * (s1[i] + s2[i] + a - b) + 4 * (b * s1[i] + b * s2[i] - s1[i]);
    	ld x1 = (a - b + s1[i] + s2[i] + sqrtl(D + EPS * EPS)) / 2.0;
    	ld x2 = (a - b + s1[i] + s2[i] - sqrtl(D + EPS * EPS)) / 2.0;
    	p[i] = x2;
    	q[i] = s1[i] + s2[i] - p[i];
    	if (p[i] - q[i] < EPS && p[i] - q[i] > -EPS) {
    		fl = true;
    	}
    	if (fl) {
    		p[i] = x1;
    		q[i] = s1[i] + s2[i] - p[i];
    	}
    	a += q[i];
    	b += p[i];
    	p[i] = kukarek(p[i]);
    	q[i] = kukarek(q[i]);
    }
    for (int i = 0; i < n; i++) {
    	cout << setprecision(30) << p[i] << ' ';
    }
    cout << endl;
    for (int i = 0; i < n; i++) {
    	cout << setprecision(30) << q[i] << ' ';
    }
    return 0;
}


#define _USE_MATH_DEFINES

#include <bits/stdc++.h>

using namespace std;

typedef long double ld;
typedef double db;
typedef long long ll;

#define int long long
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define sz(a) (signed)a.size()

const int INF = 1e18;
const ld EPS = 1e-9;

ld kukarek(ld kek) {
	if (kek < 0) {
		kek = 0;
	}
	if (kek > 1) {
		kek = 1;
	}
	return kek;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    ld s1[n], s2[n];
    for (int i = 0; i < n; i++) {
    	cin >> s1[i];
    }
    for (int i = 0; i < n; i++) {
    	cin >> s2[i];
    }
    ld p[n], q[n];
    ld a = 0, b = 0;
    for (int i = 0; i < n; i++) {
    	ld D = (s1[i] + s2[i] + a - b) * (s1[i] + s2[i] + a - b) + 4 * (b * s1[i] + b * s2[i] - s1[i]);
    	ld x1 = (a - b + s1[i] + s2[i] + sqrt(D + EPS * EPS)) / 2.0;
    	ld x2 = (a - b + s1[i] + s2[i] - sqrt(D + EPS * EPS)) / 2.0;
    	p[i] = x2;
    	if (i >= (n + 1) / 2) {
    		p[i] = x1;
    	}
    	q[i] = s1[i] + s2[i] - p[i];
    	a += q[i];
    	b += p[i];
    	p[i] = kukarek(p[i]);
    	q[i] = kukarek(q[i]);
    }
    p[n - 1] = q[n - 1] = 1;
    for (int i = 0; i < n - 1; i++) {
    	p[n - 1] -= p[i];
    	q[n - 1] -= q[i];
    }
    for (int i = 0; i < n; i++) {
    	cout << setprecision(30) << p[i] << ' ';
    }
    cout << endl;
    for (int i = 0; i < n; i++) {
    	cout << setprecision(30) << q[i] << ' ';
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define MAXN 100005
#define ll long long

int main() {
   int x1, y1, x2, y2, N;
   int dir[MAXN];
   cin >> x1 >> y1 >> x2 >> y2 >> N;
   ll dx[MAXN], dy[MAXN];
   dx[0] = dy[0] = 0;
   string s;
   cin >> s;
   for (int i=1; i<=N; i++) {
      if (s[i-1]=='U')
         dy[i]=1;
      else if (s[i-1]=='D')
         dy[i]=-1;
      else if (s[i-1]=='L')
         dx[i]=-1;
      else
         dx[i]=1;
      dy[i]+=dy[i-1];
      dx[i]+=dx[i-1];
   }
   ll low = 0;
   ll high = 2*pow(10, 17);
   //cout << high << endl;
   ll days = -1;
   while(low < high) {
      ll mid = (low+high)/2;
      if (mid<0) {
         days = -1;
         break;
      }
      ll wx=x1, wy=y1;
      //find location by wind only
      ll num = mid/N;
      wx+=num*dx[N];
      wy+=num*dy[N];
      num = mid%N;
      wx+=dx[num];
      wy+=dy[num];
      //find moves from ship and wind
      ll sm = abs(x2-wx)+abs(y2-wy);
      //cout << mid << ' ' << sm << endl;
      if (sm<=mid) {
         days = mid;
         high = mid;
      }
      else
         low = mid+1;
   }
   cout << days << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define MAXN 100005
#define ll long long

int main() {
   ll x1, y1, x2, y2, N;
   cin >> x1 >> y1 >> x2 >> y2 >> N;
   ll dx[MAXN], dy[MAXN];
   dx[0] = dy[0] = 0;
   string s;
   cin >> s;
   for (int i=1; i<=N; i++) {
      if (s[i-1]=='U')
         dy[i]=1;
      else if (s[i-1]=='D')
         dy[i]=-1;
      else if (s[i-1]=='L')
         dx[i]=-1;
      else
         dx[i]=1;
      dy[i]+=dy[i-1];
      dx[i]+=dx[i-1];
   }
   ll low = 0;
   ll high = pow(10, 18);
   //cout << high << endl;
   ll days = -1;
   while(low <= high) {
      ll mid = (low+high)/2;
      if (mid>pow(10, 16)) {
         days = -1;
         break;
      }
      ll wx=x1, wy=y1;
      //find location by wind only
      ll num = mid/N;
      wx+=num*dx[N];
      wy+=num*dy[N];
      num = mid%N;
      wx+=dx[num];
      wy+=dy[num];
      //find moves from ship and wind
      ll sm = abs(x2-wx)+abs(y2-wy);
      //cout << mid << ' ' << sm << endl;
      if (sm<=mid) {
         days = mid;
         high = mid-1;
      }
      else
         low = mid+1;
   }
   cout << days << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define MAXN 100005
#define ll long long

int main() {
   ll x1, y1, x2, y2, N;
   cin >> x1 >> y1 >> x2 >> y2 >> N;
   ll dx[MAXN], dy[MAXN];
   dx[0] = dy[0] = 0;
   string s;
   cin >> s;
   for (int i=1; i<=N; i++) {
      if (s[i-1]=='U')
         dy[i]=1;
      else if (s[i-1]=='D')
         dy[i]=-1;
      else if (s[i-1]=='L')
         dx[i]=-1;
      else
         dx[i]=1;
      dy[i]+=dy[i-1];
      dx[i]+=dx[i-1];
   }
   ll low = 0;
   ll high = pow(10, 16);
   //cout << high << endl;
   ll days = -1;
   while(low <= high) {
      ll mid = (low+high)/2;
      ll wx=x1, wy=y1;
      //find location by wind only
      ll num = mid/N;
      wx+=num*dx[N];
      wy+=num*dy[N];
      num = mid%N;
      wx+=dx[num];
      wy+=dy[num];
      //find moves from ship and wind
      ll sm = abs(x2-wx)+abs(y2-wy);
      if (x1==59109507) {
         cout << wx << ' ' << wy << endl;
         cout << mid << ' ' << sm << endl;
      }
      if (sm<=mid) {
         days = mid;
         high = mid-1;
      }
      else
         low = mid+1;
   }
   cout << days << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define MAXN 100005
#define ll long long

int main() {
   ll x1, y1, x2, y2, N;
   cin >> x1 >> y1 >> x2 >> y2 >> N;
   ll dx[MAXN], dy[MAXN];
   dx[0] = dy[0] = 0;
   string s;
   cin >> s;
   for (int i=1; i<=N; i++) {
      if (s[i-1]=='U')
         dy[i]=1;
      else if (s[i-1]=='D')
         dy[i]=-1;
      else if (s[i-1]=='L')
         dx[i]=-1;
      else
         dx[i]=1;
      dy[i]+=dy[i-1];
      dx[i]+=dx[i-1];
   }
   ll low = 0;
   ll high = pow(10, 17);
   //cout << high << endl;
   ll days = -1;
   while(low <= high) {
      ll mid = (low+high)/2;
      ll wx=x1, wy=y1;
      //find location by wind only
      ll num = mid/N;
      wx+=num*dx[N];
      wy+=num*dy[N];
      num = mid%N;
      wx+=dx[num];
      wy+=dy[num];
      //find moves from ship and wind
      ll sm = abs(x2-wx)+abs(y2-wy);
      //cout << mid << ' ' << sm << endl;
      if (sm<=mid) {
         days = mid;
         high = mid-1;
      }
      else
         low = mid+1;
   }
   cout << days << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define MAXN 100005
#define ll long long

int main() {
   int x1, y1, x2, y2, N;
   int dir[MAXN];
   cin >> x1 >> y1 >> x2 >> y2 >> N;
   ll dx[MAXN], dy[MAXN];
   dx[0] = dy[0] = 0;
   string s;
   cin >> s;
   for (int i=1; i<=N; i++) {
      if (s[i-1]=='U')
         dy[i]=1;
      else if (s[i-1]=='D')
         dy[i]=-1;
      else if (s[i-1]=='L')
         dx[i]=-1;
      else
         dx[i]=1;
      dy[i]+=dy[i-1];
      dx[i]+=dx[i-1];
   }
   ll low = 0;
   ll high = 9223372036854775807;
   ll days = -1;
   while(low < high) {
      ll mid = (low+high)/2;
      ll wx=x1, wy=y1;
      //find location by wind only
      ll num = mid/N;
      wx+=num*dx[N];
      wy+=num*dy[N];
      num = mid%N;
      wx+=dx[num];
      wy+=dy[num];
      //find moves from ship and wind
      ll sm = abs(x2-wx)+abs(y2-wy);
      //cout << mid << ' ' << sm << endl;
      if (sm<=mid) {
         days = mid;
         high = mid;
      }
      else
         low = mid+1;
   }
   cout << days << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define MAXN 100005
#define ll long long

int main() {
   int x1, y1, x2, y2, N;
   int dir[MAXN];
   cin >> x1 >> y1 >> x2 >> y2 >> N;
   ll dx[MAXN], dy[MAXN];
   dx[0] = dy[0] = 0;
   string s;
   cin >> s;
   for (int i=1; i<=N; i++) {
      if (s[i-1]=='U')
         dy[i]=1;
      else if (s[i-1]=='D')
         dy[i]=-1;
      else if (s[i-1]=='L')
         dx[i]=-1;
      else
         dx[i]=1;
      dy[i]+=dy[i-1];
      dx[i]+=dx[i-1];
   }
   ll low = 0;
   ll high = 2*pow(10, 9);
   ll days = -1;
   while(low < high) {
      ll mid = (low+high)/2;
      ll wx=x1, wy=y1;
      //find location by wind only
      ll num = mid/N;
      wx+=num*dx[N];
      wy+=num*dy[N];
      num = mid%N;
      wx+=dx[num];
      wy+=dy[num];
      //find moves from ship and wind
      ll sm = abs(x2-wx)+abs(y2-wy);
      //cout << mid << endl;
      //cout << sm << endl;
      if (sm<=mid) {
         days = mid;
         high = mid;
      }
      else
         low = mid+1;
   }
   cout << days << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define MAXN 100005
#define ll long long

int main() {
   int x1, y1, x2, y2, N;
   int dir[MAXN];
   cin >> x1 >> y1 >> x2 >> y2 >> N;
   ll dx[MAXN], dy[MAXN];
   dx[0] = dy[0] = 0;
   string s;
   cin >> s;
   for (int i=1; i<=N; i++) {
      if (s[i-1]=='U')
         dy[i]=1;
      else if (s[i-1]=='D')
         dy[i]=-1;
      else if (s[i-1]=='L')
         dx[i]=-1;
      else
         dx[i]=1;
      dy[i]+=dy[i-1];
      dx[i]+=dx[i-1];
   }
   ll low = 0;
   ll high = 2*pow(10, 17);
   //cout << high << endl;
   ll days = -1;
   while(low < high) {
      ll mid = (low+high)/2;
      ll wx=x1, wy=y1;
      //find location by wind only
      ll num = mid/N;
      wx+=num*dx[N];
      wy+=num*dy[N];
      num = mid%N;
      wx+=dx[num];
      wy+=dy[num];
      //find moves from ship and wind
      ll sm = abs(x2-wx)+abs(y2-wy);
      //cout << mid << ' ' << sm << endl;
      if (sm<=mid) {
         days = mid;
         high = mid;
      }
      else
         low = mid+1;
   }
   cout << days << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define MAXN 100005
#define ll long long

int main() {
   ll x1, y1, x2, y2, N;
   cin >> x1 >> y1 >> x2 >> y2 >> N;
   ll dx[MAXN], dy[MAXN];
   dx[0] = dy[0] = 0;
   string s;
   cin >> s;
   for (int i=1; i<=N; i++) {
      if (s[i-1]=='U')
         dy[i]=1;
      else if (s[i-1]=='D')
         dy[i]=-1;
      else if (s[i-1]=='L')
         dx[i]=-1;
      else
         dx[i]=1;
      dy[i]+=dy[i-1];
      dx[i]+=dx[i-1];
   }
   ll low = 0;
   ll high = pow(10, 16);
   //cout << high << endl;
   ll days = -1;
   while(low <= high) {
      ll mid = (low+high)/2;
      ll wx=x1, wy=y1;
      //find location by wind only
      ll num = mid/N;
      wx+=num*dx[N];
      wy+=num*dy[N];
      num = mid%N;
      wx+=dx[num];
      wy+=dy[num];
      //find moves from ship and wind
      ll sm = abs(x2-wx)+abs(y2-wy);
      //cout << mid << ' ' << sm << endl;
      if (sm<=mid) {
         days = mid;
         high = mid-1;
      }
      else
         low = mid+1;
   }
   cout << days << endl;
}


#include <iostream>
#include <vector>
#include <string>
using namespace std;

#define x first
#define y second

typedef long long Long;
typedef pair<Long, Long> PLL;

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	PLL ST, EN;
	Long Len, X = 0, Y = 0, I, Min = 2147483647, pMin = -1;
	vector<Long> D;
	string S;

	cin >> ST.x >> ST.y >> EN.x >> EN.y >> Len;
	ST.x = EN.x - ST.x;
	ST.y = EN.y - ST.y;
	cin.ignore(32767, '\n');
	getline(cin, S);
	D.resize(Len+1);
	D[0] = abs(ST.x) + abs(ST.y);

	for(I=0; I<Len; ++I)
	{
		switch(S[I])
		{
			case 'U':
				++Y; break;

			case 'D':
				--Y; break;

			case 'L':
				--X; break;

			case 'R':
				++X; break;
		}

		D[I+1] = max(0LL, abs(ST.x-X)+abs(ST.y-Y)-I-1);
		if(D[I+1]<Min)
		{
			Min = D[I+1];
			pMin = I+1;
		}
	}

	if(Min>=D[0]) cout << -1;
	else if(Min==0)
		cout << pMin;
	else
	{
		X = D[0] - Min;
		Y = D[0]/X;
		for(long i=1; i<=Len; ++i)
			if(D[0]<=X*Y+D[0]-D[i])
			{
				cout << Y*Len + i;
				break;
			}
	}

	return 0;
}


#include <iostream>
#include <vector>
#include <string>
using namespace std;

#define x first
#define y second

typedef long long Long;
typedef pair<Long, Long> PLL;

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	PLL ST, EN;
	Long Len, X = 0, Y = 0, I, Min = 2147483647, pMin = -1;
	vector<Long> D;
	string S;

	cin >> ST.x >> ST.y >> EN.x >> EN.y >> Len;
	ST.x = EN.x - ST.x;
	ST.y = EN.y - ST.y;
	cin.ignore(32767, '\n');
	getline(cin, S);
	D.resize(Len+1);
	D[0] = abs(ST.x) + abs(ST.y);

	for(I=0; I<Len; ++I)
	{
		switch(S[I])
		{
			case 'U':
				++Y; break;

			case 'D':
				--Y; break;

			case 'L':
				--X; break;

			case 'R':
				++X; break;
		}

		D[I+1] = abs(ST.x-X)+abs(ST.y-Y)-I-1;
		if(D[I+1]<Min && Min>0)
		{
			Min = D[I+1];
			pMin = I+1;
		}
	}

	// for(long i=0; i<=Len; ++i)
		// cout << i << ' ' << D[i] << endl;

	if(Min>=D[0]) cout << -1;
	else if(Min<=0)
		cout << pMin;
	else
	{
		X = D[0] - Min;
		Y = D[0]/X;
		for(long i=0; i<=Len; ++i)
			if(D[0]<=X*Y+D[0]-D[i])
			{
				cout << Y*Len + i;
				break;
			}
	}

	return 0;
}


#include <iostream>
#include <vector>
#include <string>
using namespace std;

#define x first
#define y second

typedef long long Long;
typedef pair<Long, Long> PLL;

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	PLL ST, EN;
	Long Len, X = 0, Y = 0, I, Min = 2147483647, pMin = -1;
	vector<Long> D;
	string S;

	cin >> ST.x >> ST.y >> EN.x >> EN.y >> Len;
	ST.x = EN.x - ST.x;
	ST.y = EN.y - ST.y;
	cin.ignore(32767, '\n');
	getline(cin, S);
	D.resize(Len+1);
	D[0] = abs(ST.x) + abs(ST.y);

	for(I=0; I<Len; ++I)
	{
		switch(S[I])
		{
			case 'U':
				++Y; break;

			case 'D':
				--Y; break;

			case 'L':
				--X; break;

			case 'R':
				++X; break;
		}

		D[I+1] = max(0LL, abs(ST.x-X)+abs(ST.y-Y)-I-1);
		if(D[I+1]<Min)
		{
			Min = D[I+1];
			pMin = I+1;
		}
	}

	// for(long i=0; i<=Len; ++i)
		// cout << i << ' ' << D[i] << endl;

	if(Min>=D[0]) cout << -1;
	else if(Min==0)
		cout << pMin;
	else
	{
		X = D[0] - Min;
		Y = D[0]/X;
		for(long i=0; i<=Len; ++i)
			if(D[0]<=X*Y+D[0]-D[i])
			{
				cout << Y*Len + i;
				break;
			}
	}

	return 0;
}


#include <iostream>
#include <vector>
#include <string>
using namespace std;

#define x first
#define y second

typedef long long Long;
typedef pair<Long, Long> PLL;

int main()
{
	//ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	PLL ST, EN;
	Long Len, X = 0, Y = 0, I, pMin = -1;
	vector<Long> D;
	string S;

	cin >> ST.x >> ST.y >> EN.x >> EN.y >> Len;
	ST.x = EN.x - ST.x;
	ST.y = EN.y - ST.y;
	cin.ignore(32767, '\n');
	getline(cin, S);
	D.resize(Len+1);
	D[0] = abs(ST.x) + abs(ST.y);

	for(I=0; I<Len; ++I)
	{
		switch(S[I])
		{
			case 'U':
				++Y; break;

			case 'D':
				--Y; break;

			case 'L':
				--X; break;

			case 'R':
				++X; break;
		}

		D[I+1] = abs(ST.x-X)+abs(ST.y-Y)-I-1;
		if(D[I+1]<D[I])
			pMin = I+1;

		D[I+1] = min(D[I], D[I+1]);
	}

	// for(long i=0; i<=Len; ++i)
		// cout << i << ' ' << D[i] << endl;

	if(D[Len]>=D[0]) cout << -1;
	else
	{
		X = D[0] - D[Len];
		Y = D[0]/X;
		for(I=0; I<=Len; ++I)
			if(X*Y+D[0]-D[I]==D[0])
			{
				cout << Y*Len + I;
				break;
			}
		if(I>Len) cout << -1;
	}

	return 0;
}


#include <iostream>
#include <vector>
#include <string>
using namespace std;

#define x first
#define y second

typedef long long Long;
typedef pair<Long, Long> PLL;

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	PLL ST, EN;
	Long Len, X = 0, Y = 0, I, Min = 2147483647, pMin = -1;
	vector<Long> D;
	string S;

	cin >> ST.x >> ST.y >> EN.x >> EN.y >> Len;
	ST.x = EN.x - ST.x;
	ST.y = EN.y - ST.y;
	cin.ignore(32767, '\n');
	getline(cin, S);
	D.resize(Len+1);
	D[0] = abs(ST.x) + abs(ST.y);

	for(I=0; I<Len; ++I)
	{
		switch(S[I])
		{
			case 'U':
				++Y; break;

			case 'D':
				--Y; break;

			case 'L':
				--X; break;

			case 'R':
				++X; break;
		}

		D[I+1] = abs(ST.x-X)+abs(ST.y-Y)-I-1;
		if(D[I]<D[I-1])
			pMin = I;

		D[I+1] = min(D[I], D[I+1]);
	}

	// for(long i=0; i<=Len; ++i)
		// cout << i << ' ' << D[i] << endl;

	if(D[Len]>=D[0]) cout << -1;
	else
	{
		X = D[0] - D[Len];
		Y = D[0]/X;
		for(long i=0; i<=Len; ++i)
			if(X*Y+D[0]-D[i]>=D[0])
			{
				cout << Y*Len + i;
				break;
			}
	}

	return 0;
}


#include <iostream>
#include <vector>
#include <string>
using namespace std;

#define x first
#define y second

typedef long long Long;
typedef pair<Long, Long> PLL;

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	PLL ST, EN;
	Long Len, X = 0, Y = 0, I, Min = 2147483647, pMin = -1;
	vector<Long> D;
	string S;

	cin >> ST.x >> ST.y >> EN.x >> EN.y >> Len;
	ST.x = EN.x - ST.x;
	ST.y = EN.y - ST.y;
	cin.ignore(32767, '\n');
	getline(cin, S);
	D.resize(Len+1);
	D[0] = abs(ST.x) + abs(ST.y);

	for(I=0; I<Len; ++I)
	{
		switch(S[I])
		{
			case 'U':
				++Y; break;

			case 'D':
				--Y; break;

			case 'L':
				--X; break;

			case 'R':
				++X; break;
		}

		D[I+1] = abs(ST.x-X)+abs(ST.y-Y)-I-1;
		if(D[I+1]<D[I])
			pMin = I+1;

		D[I+1] = min(D[I], D[I+1]);
	}

	// for(long i=0; i<=Len; ++i)
		// cout << i << ' ' << D[i] << endl;

	if(D[Len]>=D[0]) cout << -1;
	else
	{
		X = D[0] - D[Len];
		Y = D[0]/X;
		for(long i=0; i<=Len; ++i)
			if(X*Y+D[0]-D[i]>=D[0])
			{
				cout << Y*Len + i;
				break;
			}
	}

	return 0;
}


#include <iostream>
#include <vector>
#include <string>
using namespace std;

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	long long STx, STy, ENx, ENy, N, Curx, Cury;
	long long L, R, M, Answer = -1;
	vector<long> DX, DY;
	string S;

	cin >> STx >> STy >> ENx >> ENy >> N;
	DX.resize(N+1, 0);
	DY.resize(N+1, 0);
	cin.clear(); cin.ignore(32767, '\n');
	getline(cin, S);
	S = '$' + S;

	for(long i=1; i<=N; ++i)
	{
		DX[i] = DX[i-1] + long(S[i]=='R') - long(S[i]=='L');
		DY[i] = DY[i-1] + long(S[i]=='U') - long(S[i]=='D');
	}

	L = 0; R = 1'000'000'000'000'000'000;
	while(L<=R)
	{
		M = (L+R) >> 1;
		Curx = STx + (M/N)*DX[N] + DX[M%N];
		Cury = STy + (M/N)*DY[N] + DY[M%N];

		if(abs(Curx-ENx)+abs(Cury-ENy)<=M)
		{
			Answer = M;
			R = M - 1;
		}
		else
			L = M + 1;
	}

	cout << Answer;
	return 0;
}


#include <iostream>
#include <vector>
#include <string>
using namespace std;

#define x first
#define y second

typedef long long Long;
typedef pair<Long, Long> PLL;

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	PLL ST, EN;
	Long Len, X = 0, Y = 0, I, Min = 2147483647, pMin = -1;
	vector<Long> D;
	string S;

	cin >> ST.x >> ST.y >> EN.x >> EN.y >> Len;
	ST.x = EN.x - ST.x;
	ST.y = EN.y - ST.y;
	cin.ignore(32767, '\n');
	getline(cin, S);
	D.resize(Len+1);
	D[0] = abs(ST.x) + abs(ST.y);

	for(I=0; I<Len; ++I)
	{
		switch(S[I])
		{
			case 'U':
				++Y; break;

			case 'D':
				--Y; break;

			case 'L':
				--X; break;

			case 'R':
				++X; break;
		}

		D[I+1] = abs(ST.x-X)+abs(ST.y-Y)-I-1;
		if(D[I]<D[I-1])
			pMin = I;

		D[I+1] = min(D[I], D[I+1]);
		if(D[I+1]<0) D[I+1] = 0;
	}

	// for(long i=0; i<=Len; ++i)
		// cout << i << ' ' << D[i] << endl;

	if(D[Len]>=D[0]) cout << -1;
	else
	{
		X = D[0] - D[Len];
		Y = D[0]/X;
		for(long i=0; i<=Len; ++i)
			if(X*Y+D[0]-D[i]>=D[0])
			{
				cout << Y*Len + i;
				break;
			}
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define trav(a, x) for (auto& a : x)
using ull = uint64_t;
using ll = int64_t;
using PII = pair<int, int>;
using VI = vector<int>;
#define INF (1ll<<60)

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A> string to_string(A v) {
bool first = true; string res = "{";
for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); }
res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H); debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    ll x1, y1, x2, y2, n;
    string s;
    cin >> x1 >> y1 >> x2 >> y2 >> n >> s;
    pair<ll, ll> p{0, 0};
    REP(i, n) {
    	if (s[i] == 'L') p.first--;
    	else if (s[i] == 'R') p.first++;
    	else if (s[i] == 'U') p.second++;
    	else if (s[i] == 'D') p.second--;
    	ll x3 = x1 + p.first;
    	ll y3 = y1 + p.second;
    	if (abs(x2 - x3) + abs(y2 - y3) <= i + 1) {
    		cout << i + 1 << '\n';
    		return 0;
    	}
    }
    if (abs(x2 - p.first) + abs(y2 - p.second) - n >= abs(x2 - x1) + abs(y2 - y1)) {
    	cout << -1 << '\n';
    	return 0;
    }
    ll x = 0, y = 0, ans = 0;
    // while (true) {
    // 	x += p.first;
    // 	y += p.second;
    // 	ans += n;
    // 	if (abs(x2 - x) + abs(y2 - y) > ans) continue;
    // 	else break;
    // }
    ll pp = abs(x2 - x1) + abs(y2 - y1);
    ll q = abs(p.first) + abs(p.second) + n;
    ll k = pp / q;
    // cout << k << endl;
    x += p.first * k;
    y += p.second * k;
    ans += n * k;

    if (abs(x2 - x) + abs(y2 - y) <= ans) {
    	cout << ans << '\n';
    	return 0;
    } else {
    	// x -= p.first;
    	// y -= p.second;
    	// ans -= n;
    	REP(i, n) {
    		if (s[i] == 'L') x--;
	    	else if (s[i] == 'R') x++;
	    	else if (s[i] == 'U') y++;
	    	else if (s[i] == 'D') y--;
	    	ans++;
	    	if (abs(x2 - x) + abs(y2 - y) <= ans) {
	    		cout << ans << '\n';
	    		return 0;
	    	}
    	}
    }
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define trav(a, x) for (auto& a : x)
using ull = uint64_t;
using ll = int64_t;
using PII = pair<int, int>;
using VI = vector<int>;
#define INF (1ll<<60)

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A> string to_string(A v) {
bool first = true; string res = "{";
for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); }
res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H); debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    ll x1, y1, x2, y2, n;
    string s;
    cin >> x1 >> y1 >> x2 >> y2 >> n >> s;
    pair<ll, ll> p{0, 0};
    REP(i, n) {
    	if (s[i] == 'L') p.first--;
    	else if (s[i] == 'R') p.first++;
    	else if (s[i] == 'U') p.second++;
    	else if (s[i] == 'D') p.second--;
    	ll x3 = x1 + p.first;
    	ll y3 = y1 + p.second;
    	if (abs(x2 - x3) + abs(y2 - y3) <= i + 1) {
    		cout << i + 1 << '\n';
    		return 0;
    	}
    }
    if (abs(x2 - p.first) + abs(y2 - p.second) > abs(x2 - x1) + abs(y2 - y1)) {
    	cout << -1 << '\n';
    	return 0;
    }
    ll x = 0, y = 0, ans = 0;
    while (true) {
    	x += p.first;
    	y += p.second;
    	ans += n;
    	if (abs(x2 - x) + abs(y2 - y) > ans) continue;
    	else break;
    }
    if (abs(x2 - x) + abs(y2 - y) > ans) {
    	cout << ans << '\n';
    	return 0;
    } else {
    	x -= p.first;
    	y -= p.second;
    	ans -= n;
    	REP(i, n) {
    		if (s[i] == 'L') x--;
	    	else if (s[i] == 'R') x++;
	    	else if (s[i] == 'U') y++;
	    	else if (s[i] == 'D') y--;
	    	ans++;
	    	if (abs(x2 - x) + abs(y2 - y) <= ans) {
	    		cout << ans << '\n';
	    		return 0;
	    	}
    	}
    }
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define trav(a, x) for (auto& a : x)
using ull = uint64_t;
using ll = int64_t;
using PII = pair<int, int>;
using VI = vector<int>;
#define INF (1ll<<60)

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A> string to_string(A v) {
bool first = true; string res = "{";
for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); }
res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H); debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    ll x1, y1, x2, y2, n;
    string s;
    cin >> x1 >> y1 >> x2 >> y2 >> n >> s;
    pair<ll, ll> p{0, 0};
    REP(i, n) {
    	if (s[i] == 'L') p.first--;
    	else if (s[i] == 'R') p.first++;
    	else if (s[i] == 'U') p.second++;
    	else if (s[i] == 'D') p.second--;
    	ll x3 = x1 + p.first;
    	ll y3 = y1 + p.second;
    	if (abs(x2 - x3) + abs(y2 - y3) <= i + 1) {
    		cout << i + 1 << '\n';
    		return 0;
    	}
    }
    // if (abs(x2 - p.first) + abs(y2 - p.second) - n >= abs(x2 - x1) + abs(y2 - y1)) {
    if (abs(x2 - x1) - abs(x2 - (x1 + p.first)) + abs(y2 - y1) - abs(y2 - (y1 + p.second)) + n <= 0) {
    	cout << -1 << '\n';
    	return 0;
    }
    ll x = 0, y = 0, ans = 0;
    // while (true) {
    // 	x += p.first;
    // 	y += p.second;
    // 	ans += n;
    // 	if (abs(x2 - x) + abs(y2 - y) > ans) continue;
    // 	else break;
    // }
    ll pp = abs(x2 - x1) + abs(y2 - y1);
    // ll q = abs(p.first) + abs(p.second) + n;
    ll q = abs(x2 - x1) - abs(x2 - (x1 + p.first)) + abs(y2 - y1) - abs(y2 - (y1 + p.second)) + n;
    ll k = pp / q;
    // cout << k << endl;
    x += p.first * k;
    y += p.second * k;
    ans += n * k;

    if (abs(x2 - x) + abs(y2 - y) <= ans) {
    	cout << ans << '\n';
    	return 0;
    } else {
    	// x -= p.first;
    	// y -= p.second;
    	// ans -= n;
    	REP(i, n) {
    		if (s[i] == 'L') x--;
	    	else if (s[i] == 'R') x++;
	    	else if (s[i] == 'U') y++;
	    	else if (s[i] == 'D') y--;
	    	ans++;
	    	if (abs(x2 - x) + abs(y2 - y) <= ans) {
	    		cout << ans << '\n';
	    		return 0;
	    	}
    	}
    }
    cout << ans << '\n';
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define trav(a, x) for (auto& a : x)
using ull = uint64_t;
using ll = int64_t;
using PII = pair<int, int>;
using VI = vector<int>;
#define INF (1ll<<60)

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A> string to_string(A v) {
bool first = true; string res = "{";
for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); }
res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H); debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    ll x1, y1, x2, y2, n;
    string s;
    cin >> x1 >> y1 >> x2 >> y2 >> n >> s;
    pair<ll, ll> p{0, 0};
    REP(i, n) {
    	if (s[i] == 'L') p.first--;
    	else if (s[i] == 'R') p.first++;
    	else if (s[i] == 'U') p.second++;
    	else if (s[i] == 'D') p.second--;
    	ll x3 = x1 + p.first;
    	ll y3 = y1 + p.second;
    	if (abs(x2 - x3) + abs(y2 - y3) <= i + 1) {
    		cout << i + 1 << '\n';
    		return 0;
    	}
    }
    if (abs(x2 - p.first) + abs(y2 - p.second) - n >= abs(x2 - x1) + abs(y2 - y1)) {
    	cout << -1 << '\n';
    	return 0;
    }
    ll x = 0, y = 0, ans = 0;
    while (true) {
    	x += p.first;
    	y += p.second;
    	ans += n;
    	if (abs(x2 - x) + abs(y2 - y) > ans) continue;
    	else break;
    }
    if (abs(x2 - x) + abs(y2 - y) > ans) {
    	cout << ans << '\n';
    	return 0;
    } else {
    	x -= p.first;
    	y -= p.second;
    	ans -= n;
    	REP(i, n) {
    		if (s[i] == 'L') x--;
	    	else if (s[i] == 'R') x++;
	    	else if (s[i] == 'U') y++;
	    	else if (s[i] == 'D') y--;
	    	ans++;
	    	if (abs(x2 - x) + abs(y2 - y) <= ans) {
	    		cout << ans << '\n';
	    		return 0;
	    	}
    	}
    }
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define trav(a, x) for (auto& a : x)
using ull = uint64_t;
using ll = int64_t;
using PII = pair<int, int>;
using VI = vector<int>;
#define INF (1ll<<50)

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A> string to_string(A v) {
bool first = true; string res = "{";
for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); }
res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H); debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    ll x1, y1, x2, y2, n;
    string s;
    cin >> x1 >> y1 >> x2 >> y2 >> n >> s;
    pair<ll, ll> pp{0, 0};
    vector<pair<ll, ll> > V;
    REP(i, n) {
    	if (s[i] == 'L') pp.first--;
    	else if (s[i] == 'R') pp.first++;
    	else if (s[i] == 'U') pp.second++;
    	else if (s[i] == 'D') pp.second--;
    	V.pb(pp);
    }
    ll x = 99999999999999;
    ll mn = 0, mx = x;
	ll k = x / n;
	ll a = pp.first * k + V[x%n].first;
	ll b = pp.second * k + V[x%n].second;
	if (abs(x2 - (x1 + a)) + abs(y2 - (y1 + b)) <= x) {
		mx = x;
	} else {
		cout << -1 << '\n';
		return 0;
	}

	ll ans = mx;
	while (mn < mx) {
		ll mid = (mn + mx) / 2;
		k = mid / n;
		if (mid % n == 0) {
			a = pp.first * k;
			b = pp.second * k;
		} else {
			a = pp.first * k + V[mid%n - 1].first;
			b = pp.second * k + V[mid%n - 1].second;
		}
		if (abs(x2 - (x1 + a)) + abs(y2 - (y1 + b)) <= mid) {
			ans = mid;
			mx = mid;
		} else {
			mn = mid + 1;
		}
	}
	cout << ans << '\n';

}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define trav(a, x) for (auto& a : x)
using ull = uint64_t;
using ll = int64_t;
using PII = pair<int, int>;
using VI = vector<int>;
#define INF (1ll<<60)

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A> string to_string(A v) {
bool first = true; string res = "{";
for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); }
res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H); debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    ll x1, y1, x2, y2, n;
    string s;
    cin >> x1 >> y1 >> x2 >> y2 >> n >> s;
    pair<ll, ll> p{0, 0};
    REP(i, n) {
    	if (s[i] == 'L') p.first--;
    	else if (s[i] == 'R') p.first++;
    	else if (s[i] == 'U') p.second++;
    	else if (s[i] == 'D') p.second--;
    	ll x3 = x1 + p.first;
    	ll y3 = y1 + p.second;
    	if (abs(x2 - x3) + abs(y2 - y3) <= i + 1) {
    		cout << i + 1 << '\n';
    		return 0;
    	}
    }
    if (abs(x2 - p.first) + abs(y2 - p.second) - n >= abs(x2 - x1) + abs(y2 - y1)) {
    	cout << -1 << '\n';
    	return 0;
    }
    ll x = 0, y = 0, ans = 0;
    // while (true) {
    // 	x += p.first;
    // 	y += p.second;
    // 	ans += n;
    // 	if (abs(x2 - x) + abs(y2 - y) > ans) continue;
    // 	else break;
    // }
    ll pp = abs(x2 - x1) + abs(y2 - y1);
    ll q = abs(p.first) + abs(p.second) + n;
    ll k = pp / q;
    // cout << k << endl;
    x += p.first * k;
    y += p.second * k;
    ans += n * k;

    if (abs(x2 - x) + abs(y2 - y) <= ans) {
    	cout << ans << '\n';
    	return 0;
    } else {
    	// x -= p.first;
    	// y -= p.second;
    	// ans -= n;
    	REP(i, n) {
    		if (s[i] == 'L') x--;
	    	else if (s[i] == 'R') x++;
	    	else if (s[i] == 'U') y++;
	    	else if (s[i] == 'D') y--;
	    	ans++;
	    	if (abs(x2 - x) + abs(y2 - y) <= ans) {
	    		cout << ans << '\n';
	    		return 0;
	    	}
    	}
    }
    cout << ans << '\n';
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define trav(a, x) for (auto& a : x)
using ull = uint64_t;
using ll = int64_t;
using PII = pair<int, int>;
using VI = vector<int>;
#define INF (1ll<<50)

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A> string to_string(A v) {
bool first = true; string res = "{";
for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); }
res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H); debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    ll x1, y1, x2, y2, n;
    string s;
    cin >> x1 >> y1 >> x2 >> y2 >> n >> s;
    pair<ll, ll> pp{0, 0};
    vector<pair<ll, ll> > V;
    REP(i, n) {
    	if (s[i] == 'L') pp.first--;
    	else if (s[i] == 'R') pp.first++;
    	else if (s[i] == 'U') pp.second++;
    	else if (s[i] == 'D') pp.second--;
    	V.pb(pp);
    }
    ll x = 99999999999999;
    ll mn = 0, mx = x;
	ll k = x / n;
	ll a, b;
	if (x % n == 0) {
		a = pp.first * k;
		b = pp.second * k;
	} else {
		a = pp.first * k + V[x%n - 1].first;
		b = pp.second * k + V[x%n - 1].second;
	}
	if (abs(x2 - (x1 + a)) + abs(y2 - (y1 + b)) <= x) {
		mx = x;
	} else {
		cout << -1 << '\n';
		return 0;
	}

	ll ans = mx;
	while (mn < mx) {
		ll mid = (mn + mx) / 2;
		k = mid / n;
		if (mid % n == 0) {
			a = pp.first * k;
			b = pp.second * k;
		} else {
			a = pp.first * k + V[mid%n - 1].first;
			b = pp.second * k + V[mid%n - 1].second;
		}
		if (abs(x2 - (x1 + a)) + abs(y2 - (y1 + b)) <= mid) {
			ans = mid;
			mx = mid;
		} else {
			mn = mid + 1;
		}
	}
	cout << ans << '\n';

}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define trav(a, x) for (auto& a : x)
using ull = uint64_t;
using ll = int64_t;
using PII = pair<int, int>;
using VI = vector<int>;
#define INF (1ll<<50)

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A> string to_string(A v) {
bool first = true; string res = "{";
for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); }
res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H); debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    ll x1, y1, x2, y2, n;
    string s;
    cin >> x1 >> y1 >> x2 >> y2 >> n >> s;
    pair<ll, ll> pp{0, 0};
    vector<pair<ll, ll> > V;
    REP(i, n) {
    	if (s[i] == 'L') pp.first--;
    	else if (s[i] == 'R') pp.first++;
    	else if (s[i] == 'U') pp.second++;
    	else if (s[i] == 'D') pp.second--;
    	V.pb(pp);
    }
    ll x = 9999999999999999;
    ll mn = 0, mx = x;
	ll k = x / n;
	ll a = pp.first * k + V[x%n].first;
	ll b = pp.second * k + V[x%n].second;
	if (abs(x2 - (x1 + a)) + abs(y2 - (y1 + b)) <= x) {
		mx = x;
	} else {
		cout << -1 << '\n';
		return 0;
	}

	ll ans = mx;
	while (mn < mx) {
		ll mid = (mn + mx) / 2;
		k = mid / n;
		if (mid % n == 0) {
			a = pp.first * k;
			b = pp.second * k;
		} else {
			a = pp.first * k + V[mid%n - 1].first;
			b = pp.second * k + V[mid%n - 1].second;
		}
		if (abs(x2 - (x1 + a)) + abs(y2 - (y1 + b)) <= mid) {
			ans = mid;
			mx = mid;
		} else {
			mn = mid + 1;
		}
	}
	cout << ans << '\n';

}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define trav(a, x) for (auto& a : x)
using ull = uint64_t;
using ll = int64_t;
using PII = pair<int, int>;
using VI = vector<int>;
#define INF (1ll<<60)

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A> string to_string(A v) {
bool first = true; string res = "{";
for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); }
res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H); debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    ll x1, y1, x2, y2, n;
    string s;
    cin >> x1 >> y1 >> x2 >> y2 >> n >> s;
    pair<ll, ll> p{0, 0};
    REP(i, n) {
    	if (s[i] == 'L') p.first--;
    	else if (s[i] == 'R') p.first++;
    	else if (s[i] == 'U') p.second++;
    	else if (s[i] == 'D') p.second--;
    	ll x3 = x1 + p.first;
    	ll y3 = y1 + p.second;
    	if (abs(x2 - x3) + abs(y2 - y3) <= i + 1) {
    		cout << i + 1 << '\n';
    		return 0;
    	}
    }
    if (abs(x2 - p.first) + abs(y2 - p.second) - n >= abs(x2 - x1) + abs(y2 - y1)) {
    	cout << -1 << '\n';
    	return 0;
    }
    ll x = 0, y = 0, ans = 0;
    // while (true) {
    // 	x += p.first;
    // 	y += p.second;
    // 	ans += n;
    // 	if (abs(x2 - x) + abs(y2 - y) > ans) continue;
    // 	else break;
    // }
    ll pp = abs(x2 - x1) + abs(y2 - y1);
    // ll q = abs(p.first) + abs(p.second) + n;
    ll q = abs(x2 - x1) - abs(x2 - (x1 + p.first)) + abs(y2 - y1) - abs(y2 - (y1 + p.second)) + n;
    ll k = pp / q;
    // cout << k << endl;
    x += p.first * k;
    y += p.second * k;
    ans += n * k;

    if (abs(x2 - x) + abs(y2 - y) <= ans) {
    	cout << ans << '\n';
    	return 0;
    } else {
    	// x -= p.first;
    	// y -= p.second;
    	// ans -= n;
    	REP(i, n) {
    		if (s[i] == 'L') x--;
	    	else if (s[i] == 'R') x++;
	    	else if (s[i] == 'U') y++;
	    	else if (s[i] == 'D') y--;
	    	ans++;
	    	if (abs(x2 - x) + abs(y2 - y) <= ans) {
	    		cout << ans << '\n';
	    		return 0;
	    	}
    	}
    }
    cout << ans << '\n';
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define trav(a, x) for (auto& a : x)
using ull = uint64_t;
using ll = int64_t;
using PII = pair<int, int>;
using VI = vector<int>;
#define INF (1ll<<50)

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A> string to_string(A v) {
bool first = true; string res = "{";
for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); }
res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H); debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    ll x1, y1, x2, y2, n;
    string s;
    cin >> x1 >> y1 >> x2 >> y2 >> n >> s;
    pair<ll, ll> pp{0, 0};
    REP(i, n) {
    	if (s[i] == 'L') pp.first--;
    	else if (s[i] == 'R') pp.first++;
    	else if (s[i] == 'U') pp.second++;
    	else if (s[i] == 'D') pp.second--;
    	ll x3 = x1 + pp.first;
    	ll y3 = y1 + pp.second;
    	if (abs(x2 - x3) + abs(y2 - y3) <= i + 1) {
    		cout << i + 1 << '\n';
    		return 0;
    	}
    }
    // ll p = abs(x2 - x1) + abs(y2 - y1);
    // ll q = abs(x2 - x1) - abs(x2 - (x1 + pp.first)) + abs(y2 - y1) - abs(y2 - (y1 + pp.second)) + n;
    // if (q <= 0) {
    // 	cout << -1 << '\n';
    // 	return 0;
    // }
    ll a = 0, b = 0;
    ll ans = INF;
    REP(i, n) {
    	if (s[i] == 'L') a--;
    	else if (s[i] == 'R') a++;
    	else if (s[i] == 'U') b++;
    	else if (s[i] == 'D') b--;
    	ll x4 = x2 - a;
    	ll y4 = y2 - b;
    	ll f = abs(x4 - x1) + abs(y4 - y1) - (i + 1);
    	ll g = abs(x4 - x1) - abs(x4 - (x1 + pp.first)) + abs(y4 - y1) - abs(y4 - (y1 + pp.second)) + n;
    	if (g <= 0) {
    		continue;
    	}
    	ll k = f / g + ((f % g) != 0);
    	// cout << k << endl;
    	ans = min(ans, k * n + i + 1);
    }
    if (ans == INF) {
    	cout << -1 << '\n';
    } else {
    	cout << ans << '\n';
    }
    /*
    // if (abs(x2 - p.first) + abs(y2 - p.second) - n >= abs(x2 - x1) + abs(y2 - y1)) {
    if (abs(x2 - x1) - abs(x2 - (x1 + pp.first)) + abs(y2 - y1) - abs(y2 - (y1 + pp.second)) + n <= 0) {
    	cout << -1 << '\n';
    	return 0;
    }
    ll x = 0, y = 0, ans = 0;
    // ll q = abs(pp.first) + abs(pp.second) + n;
    ll k = p / q;
    // cout << k << endl;
    x += pp.first * k;
    y += pp.second * k;
    ans += n * k;

    if (abs(x2 - x) + abs(y2 - y) <= ans) {
    	cout << ans << '\n';
    	return 0;
    } else {
    	// x -= pp.first;
    	// y -= pp.second;
    	// ans -= n;
    	REP(i, n) {
    		if (s[i] == 'L') x--;
	    	else if (s[i] == 'R') x++;
	    	else if (s[i] == 'U') y++;
	    	else if (s[i] == 'D') y--;
	    	ans++;
	    	if (abs(x2 - x) + abs(y2 - y) <= ans) {
	    		cout << ans << '\n';
	    		return 0;
	    	}
    	}
    }
    cout << ans << '\n';
    */
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define trav(a, x) for (auto& a : x)
using ull = uint64_t;
using ll = int64_t;
using PII = pair<int, int>;
using VI = vector<int>;
#define INF (1ll<<50)

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A> string to_string(A v) {
bool first = true; string res = "{";
for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); }
res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H); debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    ll x1, y1, x2, y2, n;
    string s;
    cin >> x1 >> y1 >> x2 >> y2 >> n >> s;
    pair<ll, ll> pp{0, 0};
    vector<pair<ll, ll> > V;
    REP(i, n) {
    	if (s[i] == 'L') pp.first--;
    	else if (s[i] == 'R') pp.first++;
    	else if (s[i] == 'U') pp.second++;
    	else if (s[i] == 'D') pp.second--;
    	V.pb(pp);
    }
    ll x = 100000000000;
    ll mn = 0, mx = x;
	ll k = x / n;
	ll a = pp.first * k + V[x%n].first;
	ll b = pp.second * k + V[x%n].second;
	if (abs(x2 - (x1 + a)) + abs(y2 - (y1 + b)) <= x) {
		mx = x;
	} else {
		cout << -1 << '\n';
		return 0;
	}

	ll ans = mx;
	while (mn < mx) {
		ll mid = (mn + mx) / 2;
		k = mid / n;
		if (mid % n == 0) {
			a = pp.first * k;
			b = pp.second * k;
		} else {
			a = pp.first * k + V[mid%n - 1].first;
			b = pp.second * k + V[mid%n - 1].second;
		}
		if (abs(x2 - (x1 + a)) + abs(y2 - (y1 + b)) <= mid) {
			ans = mid;
			mx = mid;
		} else {
			mn = mid + 1;
		}
	}
	cout << ans << '\n';

}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define trav(a, x) for (auto& a : x)
using ull = uint64_t;
using ll = int64_t;
using PII = pair<int, int>;
using VI = vector<int>;
#define INF (1ll<<50)

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A> string to_string(A v) {
bool first = true; string res = "{";
for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); }
res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H); debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    ll x1, y1, x2, y2, n;
    string s;
    cin >> x1 >> y1 >> x2 >> y2 >> n >> s;
    pair<ll, ll> pp{0, 0};
    vector<pair<ll, ll> > V;
    REP(i, n) {
    	if (s[i] == 'L') pp.first--;
    	else if (s[i] == 'R') pp.first++;
    	else if (s[i] == 'U') pp.second++;
    	else if (s[i] == 'D') pp.second--;
    	V.pb(pp);
    }
    ll x = 9999999999999999;
    ll mn = 0, mx = x;
	ll k = x / n;
	ll a, b;
	if (x % n == 0) {
		a = pp.first * k;
		b = pp.second * k;
	} else {
		a = pp.first * k + V[x%n - 1].first;
		b = pp.second * k + V[x%n - 1].second;
	}
	if (abs(x2 - (x1 + a)) + abs(y2 - (y1 + b)) <= x) {
		mx = x;
	} else {
		cout << -1 << '\n';
		return 0;
	}

	ll ans = mx;
	while (mn < mx) {
		ll mid = (mn + mx) / 2;
		k = mid / n;
		if (mid % n == 0) {
			a = pp.first * k;
			b = pp.second * k;
		} else {
			a = pp.first * k + V[mid%n - 1].first;
			b = pp.second * k + V[mid%n - 1].second;
		}
		if (abs(x2 - (x1 + a)) + abs(y2 - (y1 + b)) <= mid) {
			ans = mid;
			mx = mid;
		} else {
			mn = mid + 1;
		}
	}
	cout << ans << '\n';

}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define trav(a, x) for (auto& a : x)
using ull = uint64_t;
using ll = int64_t;
using PII = pair<int, int>;
using VI = vector<int>;
#define INF (1ll<<60)

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A> string to_string(A v) {
bool first = true; string res = "{";
for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); }
res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H); debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    ll x1, y1, x2, y2, n;
    string s;
    cin >> x1 >> y1 >> x2 >> y2 >> n >> s;
    pair<ll, ll> p{0, 0};
    REP(i, n) {
    	if (s[i] == 'L') p.first--;
    	else if (s[i] == 'R') p.first++;
    	else if (s[i] == 'U') p.second++;
    	else if (s[i] == 'D') p.second--;
    	ll x3 = x1 + p.first;
    	ll y3 = y1 + p.second;
    	if (abs(x2 - x3) + abs(y2 - y3) <= i + 1) {
    		cout << i + 1 << '\n';
    		return 0;
    	}
    }
    if (abs(x2 - p.first) + abs(y2 - p.second) >= abs(x2 - x1) + abs(y2 - y1) + n) {
    	cout << -1 << '\n';
    	return 0;
    }
    ll x = 0, y = 0, ans = 0;
    while (true) {
    	x += p.first;
    	y += p.second;
    	ans += n;
    	if (abs(x2 - x) + abs(y2 - y) > ans) continue;
    	else break;
    }
    if (abs(x2 - x) + abs(y2 - y) > ans) {
    	cout << ans << '\n';
    	return 0;
    } else {
    	x -= p.first;
    	y -= p.second;
    	ans -= n;
    	REP(i, n) {
    		if (s[i] == 'L') x--;
	    	else if (s[i] == 'R') x++;
	    	else if (s[i] == 'U') y++;
	    	else if (s[i] == 'D') y--;
	    	ans++;
	    	if (abs(x2 - x) + abs(y2 - y) <= ans) {
	    		cout << ans << '\n';
	    		return 0;
	    	}
    	}
    }
}


#include "bits/stdc++.h"
using namespace std;

#define rep(i, a, b) for(int i=a; i<=b; i++)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int) x.size()
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int n, xo, yo, xl, yl;
string s;
int dx[100001];
int dy[100001];

bool check(int x){
	int a=x/n*dx[n]+dx[x%n];
	if(xl<xo || (xo==xl && a<0)) a*=-1;
	int b=x/n*dy[n]+dy[x%n];
	if(yl<yo || (yo==yl && b<0)) b*=-1;
	// cout << "a b "<<a <<" "<<b<<endl;
	// cout << abs(xl-xo)-a+abs(yl-yo)-b<<" days needed"<<endl;
	return (abs(xl-xo)-a+abs(yl-yo)-b<=x);
}
int main(){
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
	cin.sync_with_stdio(0); cin.tie();
  cin.exceptions(cin.failbit);

  cin >> xo >> yo >> xl >> yl;
  cin >> n;
  cin >> s;
  rep(i, 0, n-1){
  	if(s.at(i)=='U') dy[i+1]++;
  	else if(s.at(i)=='D') dy[i+1]--;
  	else if(s.at(i)=='R') dx[i+1]++;
  	else dx[i+1]--;
  	dx[i+1]+=dx[i];
  	dy[i+1]+=dy[i];
  }
  int ans=abs(yl-yo)+abs(xl-xo)+n;
  bool flag=false;
  for(int i=abs(yl-yo)+abs(xl-xo)+n; i>0; i/=2){
  	while(check(ans-i)){
  		flag=true;
  		ans-=i;
  	}
  }
  cout << (flag?ans:-1);
}


#include "bits/stdc++.h"
using namespace std;

#define rep(i, a, b) for(int i=a; i<=b; i++)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int) x.size()
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int n, xo, yo, xl, yl;
string s;
int dx[100001];
int dy[100001];

bool check(int x){
	ll a=x/n*dx[n]+dx[x%n];
	if(xl<xo || (xo==xl && a>0)) a*=-1;
	ll b=x/n*dy[n]+dy[x%n];
	if(yl<yo || (yo==yl && b>0)) b*=-1;
	// cout << "a b "<<a <<" "<<b<<endl;
	// cout << abs(xl-xo)-a+abs(yl-yo)-b<<" days needed"<<endl;
	return (abs(xl-xo)-a+abs(yl-yo)-b<=x);
}
int main(){
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
	cin.sync_with_stdio(0); cin.tie();
  cin.exceptions(cin.failbit);

  cin >> xo >> yo >> xl >> yl;
  cin >> n;
  cin >> s;
  rep(i, 0, n-1){
  	if(s.at(i)=='U') dy[i+1]++;
  	else if(s.at(i)=='D') dy[i+1]--;
  	else if(s.at(i)=='R') dx[i+1]++;
  	else dx[i+1]--;
  	dx[i+1]+=dx[i];
  	dy[i+1]+=dy[i];
  }
  ll ans=abs(yl-yo)+abs(xl-xo)+n;
  bool flag=false;
  for(ll i=abs(yl-yo)+abs(xl-xo)+n; i>0; i/=2){
  	while(check(ans-i)){
  		flag=true;
  		ans-=i;
  	}
  }
  cout << (flag?ans:-1);
}


#include "bits/stdc++.h"
using namespace std;

#define rep(i, a, b) for(int i=a; i<=b; i++)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int) x.size()
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int n, xo, yo, xl, yl;
string s;
int dx[100002];
int dy[100002];

bool check(ll x){
	ll a = xo+x/n*dx[n]+dx[x%n];
	ll b = yo+x/n*dy[n]+dy[x%n];
	return abs(a-xl)+abs(b-yl)<=x;
}
int main(){
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
	cin.sync_with_stdio(0); cin.tie();
  cin.exceptions(cin.failbit);

  cin >> xo >> yo >> xl >> yl;
  cin >> n;
  cin >> s;
  rep(i, 0, n-1){
  	if(s.at(i)=='U') dy[i+1]++;
  	else if(s.at(i)=='D') dy[i+1]--;
  	else if(s.at(i)=='R') dx[i+1]++;
  	else dx[i+1]--;
  	dx[i+1]+=dx[i];
  	dy[i+1]+=dy[i];
  }
  ll ans=(abs(yl-yo)+abs(xl-xo))*n+1;
  bool flag=false;
  for(ll i=(abs(yl-yo)+abs(xl-xo))*n; i>0; i/=2){
  	while(ans-i>=0 && check(ans-i)){
  		flag=true;
  		ans-=i;
  	}
  }
  cout << (flag?ans:-1);
}


#include "bits/stdc++.h"
using namespace std;

#define rep(i, a, b) for(int i=a; i<=b; i++)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int) x.size()
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int n, xo, yo, xl, yl;
string s;
int dx[100002];
int dy[100002];

bool check(ll x){
	ll a = xo+x/n*dx[n]+dx[x%n];
	ll b = yo+x/n*dy[n]+dy[x%n];
	return abs(a-xl)+abs(b-yl)<=x;
}
int main(){
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
	cin.sync_with_stdio(0); cin.tie();
  cin.exceptions(cin.failbit);

  cin >> xo >> yo >> xl >> yl;
  cin >> n;
  cin >> s;
  rep(i, 0, n-1){
  	if(s.at(i)=='U') dy[i+1]++;
  	else if(s.at(i)=='D') dy[i+1]--;
  	else if(s.at(i)=='R') dx[i+1]++;
  	else dx[i+1]--;
  	dx[i+1]+=dx[i];
  	dy[i+1]+=dy[i];
  }
  ll ans=1e18;
  bool flag=false;
  for(ll i=1e18; i>0; i/=2){
  	while(ans-i>=0 && check(ans-i)){
  		flag=true;
  		ans-=i;
  	}
  }
  cout << (flag?ans:-1);
}


#include "bits/stdc++.h"
using namespace std;

#define rep(i, a, b) for(int i=a; i<=b; i++)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int) x.size()
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int n, xo, yo, xl, yl;
string s;
int dx[100001];
int dy[100001];

bool check(int x){
	int a=x/n*dx[n]+dx[x%n];
	if(xl<xo || (xo==xl && a>0)) a*=-1;
	int b=x/n*dy[n]+dy[x%n];
	if(yl<yo || (yo==yl && b>0)) b*=-1;
	// cout << "a b "<<a <<" "<<b<<endl;
	// cout << abs(xl-xo)-a+abs(yl-yo)-b<<" days needed"<<endl;
	return (abs(xl-xo)-a+abs(yl-yo)-b<=x);
}
int main(){
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
	cin.sync_with_stdio(0); cin.tie();
  cin.exceptions(cin.failbit);

  cin >> xo >> yo >> xl >> yl;
  cin >> n;
  cin >> s;
  rep(i, 0, n-1){
  	if(s.at(i)=='U') dy[i+1]++;
  	else if(s.at(i)=='D') dy[i+1]--;
  	else if(s.at(i)=='R') dx[i+1]++;
  	else dx[i+1]--;
  	dx[i+1]+=dx[i];
  	dy[i+1]+=dy[i];
  }
  int ans=abs(yl-yo)+abs(xl-xo)+n;
  bool flag=false;
  for(int i=abs(yl-yo)+abs(xl-xo)+n; i>0; i/=2){
  	while(check(ans-i)){
  		flag=true;
  		ans-=i;
  	}
  }
  cout << (flag?ans:-1);
}


#include "bits/stdc++.h"
using namespace std;

#define rep(i, a, b) for(int i=a; i<=b; i++)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int) x.size()
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int n, xo, yo, xl, yl;
string s;
int dx[100001];
int dy[100001];

bool check(int x){
	// cout << "trying "<<x<<endl;
	int a=x/n*dx[n]+dx[x%n];
	if(xl<xo || (xo==xl && dx<0)) a*=-1;
	int b=x/n*dy[n]+dy[x%n];
	if(yl<yo || (yo==yl && dy<0)) b*=-1;
	// cout << "a b "<<a <<" "<<b<<endl;
	// cout << abs(xl-xo)-a+abs(yl-yo)-b<<" days needed"<<endl;
	return (abs(xl-xo)-a+abs(yl-yo)-b<=x);
}
int main(){
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
	cin.sync_with_stdio(0); cin.tie();
  cin.exceptions(cin.failbit);

  cin >> xo >> yo >> xl >> yl;
  cin >> n;
  cin >> s;
  rep(i, 0, n-1){
  	if(s.at(i)=='U') dy[i+1]++;
  	else if(s.at(i)=='D') dy[i+1]--;
  	else if(s.at(i)=='R') dx[i+1]++;
  	else dx[i+1]--;
  	dx[i+1]+=dx[i];
  	dy[i+1]+=dy[i];
  }
  int ans=abs(yl-yo)+abs(xl-xo)+n;
  bool flag=false;
  for(int i=abs(yl-yo)+abs(xl-xo)+n-1; i>0; i/=2){
  	while(check(ans-i)){
  		flag=true;
  		ans-=i;
  	}
  }
  cout << (flag?ans:-1);
}


#include "bits/stdc++.h"
using namespace std;

#define rep(i, a, b) for(int i=a; i<=b; i++)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int) x.size()
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int n, xo, yo, xl, yl;
string s;
int dx[100002];
int dy[100002];

bool check(ll x){
	ll a=x/n*dx[n]+dx[x%n];
	if(xl<xo || (xo==xl && a>0)) a*=-1;
	ll b=x/n*dy[n]+dy[x%n];
	if(yl<yo || (yo==yl && b>0)) b*=-1;
	// cout << "a b "<<a <<" "<<b<<endl;
	// cout << abs(xl-xo)-a+abs(yl-yo)-b<<" days needed"<<endl;
	return (abs(xl-xo)-a+abs(yl-yo)-b<=x);
}
int main(){
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
	cin.sync_with_stdio(0); cin.tie();
  cin.exceptions(cin.failbit);

  cin >> xo >> yo >> xl >> yl;
  cin >> n;
  cin >> s;
  rep(i, 0, n-1){
  	if(s.at(i)=='U') dy[i+1]++;
  	else if(s.at(i)=='D') dy[i+1]--;
  	else if(s.at(i)=='R') dx[i+1]++;
  	else dx[i+1]--;
  	dx[i+1]+=dx[i];
  	dy[i+1]+=dy[i];
  }
  ll ans=(abs(yl-yo)+abs(xl-xo))*n;
  bool flag=false;
  for(ll i=(abs(yl-yo)+abs(xl-xo))*n; i>0; i/=2){
  	while(ans-i>=0 && check(ans-i)){
  		flag=true;
  		ans-=i;
  	}
  }
  cout << (flag?ans:-1);
}


#include "bits/stdc++.h"
using namespace std;

#define rep(i, a, b) for(int i=a; i<=b; i++)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int) x.size()
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int n, xo, yo, xl, yl;
string s;
int dx[100001];
int dy[100001];

bool check(int x){
	ll a=x/n*dx[n]+dx[x%n];
	if(xl<xo || (xo==xl && a>0)) a*=-1;
	ll b=x/n*dy[n]+dy[x%n];
	if(yl<yo || (yo==yl && b>0)) b*=-1;
	// cout << "a b "<<a <<" "<<b<<endl;
	// cout << abs(xl-xo)-a+abs(yl-yo)-b<<" days needed"<<endl;
	return (abs(xl-xo)-a+abs(yl-yo)-b<=x);
}
int main(){
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
	cin.sync_with_stdio(0); cin.tie();
  cin.exceptions(cin.failbit);

  cin >> xo >> yo >> xl >> yl;
  cin >> n;
  cin >> s;
  rep(i, 0, n-1){
  	if(s.at(i)=='U') dy[i+1]++;
  	else if(s.at(i)=='D') dy[i+1]--;
  	else if(s.at(i)=='R') dx[i+1]++;
  	else dx[i+1]--;
  	dx[i+1]+=dx[i];
  	dy[i+1]+=dy[i];
  }
  ll ans=abs(yl-yo)+abs(xl-xo)+n;
  bool flag=false;
  for(ll i=abs(yl-yo)+abs(xl-xo)+n; i>0; i/=2){
  	while(ans-i>=0 && check(ans-i)){
  		flag=true;
  		ans-=i;
  	}
  }
  cout << (flag?ans:-1);
}


#include "bits/stdc++.h"
using namespace std;

#define rep(i, a, b) for(int i=a; i<=b; i++)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int) x.size()
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int n, xo, yo, xl, yl;
string s;
int dx[100001];
int dy[100001];

bool check(int x){
	ll a=x/n*dx[n]+dx[x%n];
	if(xl<xo || (xo==xl && a>0)) a*=-1;
	ll b=x/n*dy[n]+dy[x%n];
	if(yl<yo || (yo==yl && b>0)) b*=-1;
	// cout << "a b "<<a <<" "<<b<<endl;
	// cout << abs(xl-xo)-a+abs(yl-yo)-b<<" days needed"<<endl;
	return (abs(xl-xo)-a+abs(yl-yo)-b<=x);
}
int main(){
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
	cin.sync_with_stdio(0); cin.tie();
  cin.exceptions(cin.failbit);

  cin >> xo >> yo >> xl >> yl;
  cin >> n;
  cin >> s;
  rep(i, 0, n-1){
  	if(s.at(i)=='U') dy[i+1]++;
  	else if(s.at(i)=='D') dy[i+1]--;
  	else if(s.at(i)=='R') dx[i+1]++;
  	else dx[i+1]--;
  	dx[i+1]+=dx[i];
  	dy[i+1]+=dy[i];
  }
  ll ans=(abs(yl-yo)+abs(xl-xo))*n;
  bool flag=false;
  for(ll i=(abs(yl-yo)+abs(xl-xo))*n; i>0; i/=2){
  	while(ans-i>=0 && check(ans-i)){
  		flag=true;
  		ans-=i;
  	}
  }
  cout << (flag?ans:-1);
}


#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <cstring>
#include <iterator>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <chrono>
#include <assert.h>
#include <memory>
#include <cstddef>
#include <iterator>

#pragma comment(linker, "/stack:20000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

using namespace std;
typedef long long mt;
typedef double fl;

template<typename T>
constexpr mt infValue = std::is_same<T, int>::value ? 2000100007 : 8600000000000000007ll;
template<typename T>
constexpr mt maxValue = std::is_same<T, int>::value ? 1000000007 : 1000000000000000001ll;

#define rep(a, b, i) for(mt i = a; i < b; ++i)
#define repe(a, b, i) for(mt i = a; i <= (b); ++i)
#define repd(a, b, i) for(mt i = a; i > b; --i)
#define repde(a, b, i) for(mt i = a; i >= b; --i)

const mt INF = infValue<mt>;
const long long MOD = 1000000007ll;//998244353ll;
const double EPS = 1e-6;
const mt MAX = maxValue<mt>;
using pr = pair<mt, mt>;

#define N 300010
#define K 5
#define P 3
#define M (N * N)
#define p2(x) ((((x) * (x)) % (MOD)))
#define mxy(x, y) ((((x) * (y)) % (MOD)))
#define p2p(x) ((((x) * (x))))

mt _x1, ty1, _x2, _y2, answ;
mt n, d[2], t[2];
char s[N];

bool f(mt cnt) {
	d[0] = d[1] = 0;
	rep(0, n, i) {
		if (s[i] == 'L') d[0] += (_x2 < _x1) * (cnt / n + (i < (cnt % n)));
		else if (s[i] == 'R') d[0] += (_x2 > _x1) * (cnt / n + (i < (cnt % n)));
		else if (s[i] == 'U') d[1] += (_y2 > ty1) * (cnt / n + (i < (cnt % n)));
		else d[1] += (_y2 < ty1) * (cnt / n + (i < (cnt % n)));
	}

	mt x = t[0];
	mt y = t[1];

	mt u = min(y, min(y, d[0]));
	y -= u, x -= u + max(0ll, d[0] - u) * 2;

	x = max(x, 0ll);
	y = max(y, 0ll);

	u = min(x, min(x, d[1]));
	x -= u, y -= u + max(0ll, d[1] - u) * 2;

	return x <= 0 && y <= 0;
}

mt bs() {
	mt u = 1e18;
	mt l = 0, r = u;
	while (r - l > 1) {
		mt md = l + r >> 1;
		if (f(md)) r = md;
		else l = md;
	}
	if (r == u) return -1;
	return r;
}

int main(void) {
#ifdef _DEBUG
	freopen("in.txt", "r", stdin);
#endif
	scanf("%lld %lld\n%lld %lld", &_x1, &ty1, &_x2, &_y2);
	scanf("%lld", &n);
	scanf("%s", s);
	t[0] = abs(_x2 - _x1);
	t[1] = abs(_y2 - ty1);

	//bool ok = f(5);
	//d = abs(_x2 - _x1) + abs(_y2 - ty1);
	printf("%lld\n", bs());

	return 0;
}


#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <cstring>
#include <iterator>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <chrono>
#include <assert.h>
#include <memory>
#include <cstddef>
#include <iterator>

#pragma comment(linker, "/stack:20000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

using namespace std;
typedef long long mt;
typedef double fl;

template<typename T>
constexpr mt infValue = std::is_same<T, int>::value ? 2000100007 : 8600000000000000007ll;
template<typename T>
constexpr mt maxValue = std::is_same<T, int>::value ? 1000000007 : 1000000000000000001ll;

#define rep(a, b, i) for(mt i = a; i < b; ++i)
#define repe(a, b, i) for(mt i = a; i <= (b); ++i)
#define repd(a, b, i) for(mt i = a; i > b; --i)
#define repde(a, b, i) for(mt i = a; i >= b; --i)

const mt INF = infValue<mt>;
const long long MOD = 1000000007ll;//998244353ll;
const double EPS = 1e-6;
const mt MAX = maxValue<mt>;
using pr = pair<mt, mt>;

#define N 300010
#define K 5
#define P 3
#define M (N * N)
#define p2(x) ((((x) * (x)) % (MOD)))
#define mxy(x, y) ((((x) * (y)) % (MOD)))
#define p2p(x) ((((x) * (x))))

mt _x1, ty1, _x2, _y2, answ;
mt n, t[2];
char s[N];

mt dec(mt& a) {
	if (!a) return 0;
	if (a > 0) --a;
	else ++a;
	return 1;
}

void build() {
	rep(0, n, i) {
		if (!t[0] && !t[1]) {
			break;
		}

		if (s[i] == 'L') {
			if (t[0] < 0) {
				dec(t[0]);
				mt x = dec(t[1]);
				if (!x) dec(t[0]);
			}
		}
		else if (s[i] == 'R') {
			if (t[0] > 0) {
				dec(t[0]);
				mt x = dec(t[1]);
				if (!x) dec(t[0]);
			}
		}
		else if (s[i] == 'U') {
			if (t[1] > 0) {
				dec(t[1]);
				mt x = dec(t[0]);
				if (!x) dec(t[1]);
			}
		}
		else if (s[i] == 'D') {
			if (t[1] < 0) {
				dec(t[1]);
				mt x = dec(t[0]);
				if (!x) dec(t[1]);
			}
		}

		++answ;
	}
}

int main(void) {
#ifdef _DEBUG
	freopen("in.txt", "r", stdin);
#endif
	scanf("%lld %lld %lld %lld", &_x1, &ty1, &_x2, &_y2);
	scanf("%lld", &n);
	scanf("%s", s);
	t[0] = _x2 - _x1;
	t[1] = _y2 - ty1;

	build();
	if (!t[0] && !t[1]) printf("%lld\n", answ);
	else {
		mt x = (_x2 - _x1) - t[0];
		mt y = (_y2 - ty1) - t[1];
		mt d = min(x ? abs(t[0] / x): 0ll, y ? abs(t[1] / y): 0ll);
		t[0] -= x * d;
		t[1] -= y * d;
		build();

		x = t[0], y = t[1];
		build();
		x -= t[0], y -= t[1];
		d = max(abs(x ? t[0] / x: 0ll), abs(y ? t[1] / y: 0ll));
		t[0] -= x * d;
		t[1] -= y * d;
		build();

		if (!t[0] && !t[1]) printf("%lld\n", answ);
		else puts("-1");
	}

	return 0;
}


#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <cstring>
#include <iterator>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <chrono>
#include <assert.h>
#include <memory>
#include <cstddef>
#include <iterator>

#pragma comment(linker, "/stack:20000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

using namespace std;
typedef long long mt;
typedef double fl;

template<typename T>
constexpr mt infValue = std::is_same<T, int>::value ? 2000100007 : 8600000000000000007ll;
template<typename T>
constexpr mt maxValue = std::is_same<T, int>::value ? 1000000007 : 1000000000000000001ll;

#define rep(a, b, i) for(mt i = a; i < b; ++i)
#define repe(a, b, i) for(mt i = a; i <= (b); ++i)
#define repd(a, b, i) for(mt i = a; i > b; --i)
#define repde(a, b, i) for(mt i = a; i >= b; --i)

const mt INF = infValue<mt>;
const long long MOD = 1000000007ll;//998244353ll;
const double EPS = 1e-6;
const mt MAX = maxValue<mt>;
using pr = pair<mt, mt>;

#define N 300010
#define K 5
#define P 3
#define M (N * N)
#define p2(x) ((((x) * (x)) % (MOD)))
#define mxy(x, y) ((((x) * (y)) % (MOD)))
#define p2p(x) ((((x) * (x))))

mt _x1, ty1, _x2, _y2, answ;
mt n, d[2], t[2];
char s[N];

bool f(mt cnt) {
	d[0] = d[1] = 0;
	rep(0, n, i) {
		if (s[i] == 'L') d[0] += (_x2 < _x1) * (cnt / n + (i < (cnt % n)));
		else if (s[i] == 'R') d[0] += (_x2 > _x1) * (cnt / n + (i < (cnt % n)));
		else if (s[i] == 'U') d[1] += (_y2 > ty1) * (cnt / n + (i < (cnt % n)));
		else d[1] += (_y2 < ty1) * (cnt / n + (i < (cnt % n)));
	}

	mt x = t[0];
	mt y = t[1];

	//mt u = min(y, min(y, d[0]));
	//y -= u, x -= u + (d[0] - u) * 2;

	//x = max(x, 0ll);
	//y = max(y, 0ll);

	//u = min(x, min(x, d[1]));
	//x -= u, y -= u + (d[1] - u) * 2;

	x -= d[0] * 2;
	y -= d[1] * 2;

	mt u = max(0ll, -y);
	mt v = max(0ll, -x);

	x -= u;
	y -= v;

	return x <= 0 && y <= 0;
}

mt bs() {
	mt u = 1e18;
	mt l = -1, r = u;
	while (r - l > 1) {
		mt md = l + r >> 1;
		if (f(md)) r = md;
		else l = md;
	}
	if (r == u) return -1;
	return r;
}

int main(void) {
#ifdef _DEBUG
	freopen("in.txt", "r", stdin);
#endif
	scanf("%lld %lld\n%lld %lld", &_x1, &ty1, &_x2, &_y2);
	scanf("%lld", &n);
	scanf("%s", s);
	t[0] = abs(_x2 - _x1);
	t[1] = abs(_y2 - ty1);

	//bool ok = f(5);
	//d = abs(_x2 - _x1) + abs(_y2 - ty1);
	printf("%lld\n", bs());

	return 0;
}


#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <cstring>
#include <iterator>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <chrono>
#include <assert.h>
#include <memory>
#include <cstddef>
#include <iterator>

#pragma comment(linker, "/stack:20000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

using namespace std;
typedef long long mt;
typedef double fl;

template<typename T>
constexpr mt infValue = std::is_same<T, int>::value ? 2000100007 : 8600000000000000007ll;
template<typename T>
constexpr mt maxValue = std::is_same<T, int>::value ? 1000000007 : 1000000000000000001ll;

#define rep(a, b, i) for(mt i = a; i < b; ++i)
#define repe(a, b, i) for(mt i = a; i <= (b); ++i)
#define repd(a, b, i) for(mt i = a; i > b; --i)
#define repde(a, b, i) for(mt i = a; i >= b; --i)

const mt INF = infValue<mt>;
const long long MOD = 1000000007ll;//998244353ll;
const double EPS = 1e-6;
const mt MAX = maxValue<mt>;
using pr = pair<mt, mt>;

#define N 300010
#define K 5
#define P 3
#define M (N * N)
#define p2(x) ((((x) * (x)) % (MOD)))
#define mxy(x, y) ((((x) * (y)) % (MOD)))
#define p2p(x) ((((x) * (x))))

mt _x1, ty1, _x2, _y2, answ;
mt n, t[2];
char s[N];

mt dec(mt& a) {
	if (!a) return 0;
	if (a > 0) --a;
	else ++a;
	return 1;
}

void build() {
	rep(0, n, i) {
		if (!t[0] && !t[1]) {
			break;
		}

		if (s[i] == 'L') {
			if (t[0] < 0) {
				dec(t[0]);
				mt x = dec(t[1]);
				if (!x) dec(t[0]);
			}
		}
		else if (s[i] == 'R') {
			if (t[0] > 0) {
				dec(t[0]);
				mt x = dec(t[1]);
				if (!x) dec(t[0]);
			}
		}
		else if (s[i] == 'U') {
			if (t[1] > 0) {
				dec(t[1]);
				mt x = dec(t[0]);
				if (!x) dec(t[1]);
			}
		}
		else if (s[i] == 'D') {
			if (t[1] < 0) {
				dec(t[1]);
				mt x = dec(t[0]);
				if (!x) dec(t[1]);
			}
		}

		++answ;
	}
}

int main(void) {
#ifdef _DEBUG
	freopen("in.txt", "r", stdin);
#endif
	scanf("%lld %lld %lld %lld", &_x1, &ty1, &_x2, &_y2);
	scanf("%lld", &n);
	scanf("%s", s);
	t[0] = _x2 - _x1;
	t[1] = _y2 - ty1;

	build();
	if (!t[0] && !t[1]) printf("%lld\n", answ);
	else {
		mt x = (_x2 - _x1) - t[0];
		mt y = (_y2 - ty1) - t[1];
		mt d = min(x ? abs(t[0] / x): 0ll, y ? abs(t[1] / y): 0ll);
		answ += d;
		t[0] -= x * d;
		t[1] -= y * d;
		build();

		x = t[0], y = t[1];
		build();
		x -= t[0], y -= t[1];
		d = max(abs(x ? t[0] / x: 0ll), abs(y ? t[1] / y: 0ll));
		answ += d;
		t[0] -= x * d;
		t[1] -= y * d;
		build();

		if (!t[0] && !t[1]) printf("%lld\n", answ);
		else puts("-1");
	}

	return 0;
}


#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <cstring>
#include <iterator>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <chrono>
#include <assert.h>
#include <memory>
#include <cstddef>
#include <iterator>

#pragma comment(linker, "/stack:20000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

using namespace std;
typedef long long mt;
typedef double fl;

template<typename T>
constexpr mt infValue = std::is_same<T, int>::value ? 2000100007 : 8600000000000000007ll;
template<typename T>
constexpr mt maxValue = std::is_same<T, int>::value ? 1000000007 : 1000000000000000001ll;

#define rep(a, b, i) for(mt i = a; i < b; ++i)
#define repe(a, b, i) for(mt i = a; i <= (b); ++i)
#define repd(a, b, i) for(mt i = a; i > b; --i)
#define repde(a, b, i) for(mt i = a; i >= b; --i)

const mt INF = infValue<mt>;
const long long MOD = 1000000007ll;//998244353ll;
const double EPS = 1e-6;
const mt MAX = maxValue<mt>;
using pr = pair<mt, mt>;

#define N 300010
#define K 5
#define P 3
#define M (N * N)
#define p2(x) ((((x) * (x)) % (MOD)))
#define mxy(x, y) ((((x) * (y)) % (MOD)))
#define p2p(x) ((((x) * (x))))

mt _x1, ty1, _x2, _y2, answ;
mt n, d[2], t[2];
char s[N];

bool f(mt cnt) {
	d[0] = d[1] = 0;
	rep(0, n, i) {
		if (s[i] == 'L') d[0] += (_x2 < _x1) * (cnt / n + (i < (cnt % n)));
		else if (s[i] == 'R') d[0] += (_x2 > _x1) * (cnt / n + (i < (cnt % n)));
		else if (s[i] == 'U') d[1] += (_y2 > ty1) * (cnt / n + (i < (cnt % n)));
		else d[1] += (_y2 < ty1) * (cnt / n + (i < (cnt % n)));
	}

	mt x = t[0];
	mt y = t[1];

	mt u = min(y, min(y, d[0]));
	y -= u, x -= u + max(0ll, d[0] - u) * 2;

	u = min(x, min(x, d[1]));
	x -= u, y -= u + max(0ll, d[1] - u) * 2;

	return x <= 0 && y <= 0;
}

mt bs() {
	mt u = 1e18;
	mt l = 0, r = u;
	while (r - l > 1) {
		mt md = l + r >> 1;
		if (f(md)) r = md;
		else l = md;
	}
	if (r == u) return -1;
	return r;
}

int main(void) {
#ifdef _DEBUG
	freopen("in.txt", "r", stdin);
#endif
	scanf("%lld %lld\n%lld %lld", &_x1, &ty1, &_x2, &_y2);
	scanf("%lld", &n);
	scanf("%s", s);
	t[0] = abs(_x2 - _x1);
	t[1] = abs(_y2 - ty1);

	//bool ok = f(5);
	//d = abs(_x2 - _x1) + abs(_y2 - ty1);
	printf("%lld\n", bs());

	return 0;
}


#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <cstring>
#include <iterator>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <chrono>
#include <assert.h>
#include <memory>
#include <cstddef>
#include <iterator>

#pragma comment(linker, "/stack:20000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

using namespace std;
typedef long long mt;
typedef double fl;

template<typename T>
constexpr mt infValue = std::is_same<T, int>::value ? 2000100007 : 8600000000000000007ll;
template<typename T>
constexpr mt maxValue = std::is_same<T, int>::value ? 1000000007 : 1000000000000000001ll;

#define rep(a, b, i) for(mt i = a; i < b; ++i)
#define repe(a, b, i) for(mt i = a; i <= (b); ++i)
#define repd(a, b, i) for(mt i = a; i > b; --i)
#define repde(a, b, i) for(mt i = a; i >= b; --i)

const mt INF = infValue<mt>;
const long long MOD = 1000000007ll;//998244353ll;
const double EPS = 1e-6;
const mt MAX = maxValue<mt>;
using pr = pair<mt, mt>;

#define N 300010
#define K 5
#define P 3
#define M (N * N)
#define p2(x) ((((x) * (x)) % (MOD)))
#define mxy(x, y) ((((x) * (y)) % (MOD)))
#define p2p(x) ((((x) * (x))))

mt _x1, ty1, _x2, _y2, answ;
mt n, d[2], t[2];
char s[N];

bool f(mt cnt) {
	d[0] = d[1] = 0;
	rep(0, n, i) {
		if (s[i] == 'L') d[0] += (_x2 < _x1) * (cnt / n + (i < (cnt % n)));
		else if (s[i] == 'R') d[0] += (_x2 > _x1) * (cnt / n + (i < (cnt % n)));
		else if (s[i] == 'U') d[1] += (_y2 > ty1) * (cnt / n + (i < (cnt % n)));
		else d[1] += (_y2 < ty1) * (cnt / n + (i < (cnt % n)));
	}

	mt x = t[0];
	mt y = t[1];

	mt u = min(y, min(x, d[0]));
	y -= u, x -= u + max(0ll, d[0] - u) * 2;

	u = min(x, min(y, d[1]));
	x -= u, y -= u + max(0ll, d[1] - u) * 2;

	return x <= 0 && y <= 0;
}

mt bs() {
	mt u = 1e18;
	mt l = 0, r = u;
	while (r - l > 1) {
		mt md = l + r >> 1;
		if (f(md)) r = md;
		else l = md;
	}
	if (r == u) return -1;
	return r;
}

int main(void) {
#ifdef _DEBUG
	freopen("in.txt", "r", stdin);
#endif
	scanf("%lld %lld %lld %lld", &_x1, &ty1, &_x2, &_y2);
	scanf("%lld", &n);
	scanf("%s", s);
	t[0] = abs(_x2 - _x1);
	t[1] = abs(_y2 - ty1);

	//bool ok = f(5);
	//d = abs(_x2 - _x1) + abs(_y2 - ty1);
	printf("%lld\n", bs());

	return 0;
}


#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <cstring>
#include <iterator>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <chrono>
#include <assert.h>
#include <memory>
#include <cstddef>
#include <iterator>

#pragma comment(linker, "/stack:20000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

using namespace std;
typedef long long mt;
typedef double fl;

template<typename T>
constexpr mt infValue = std::is_same<T, int>::value ? 2000100007 : 8600000000000000007ll;
template<typename T>
constexpr mt maxValue = std::is_same<T, int>::value ? 1000000007 : 1000000000000000001ll;

#define rep(a, b, i) for(mt i = a; i < b; ++i)
#define repe(a, b, i) for(mt i = a; i <= (b); ++i)
#define repd(a, b, i) for(mt i = a; i > b; --i)
#define repde(a, b, i) for(mt i = a; i >= b; --i)

const mt INF = infValue<mt>;
const long long MOD = 1000000007ll;//998244353ll;
const double EPS = 1e-6;
const mt MAX = maxValue<mt>;
using pr = pair<mt, mt>;

#define N 300010
#define K 5
#define P 3
#define M (N * N)
#define p2(x) ((((x) * (x)) % (MOD)))
#define mxy(x, y) ((((x) * (y)) % (MOD)))
#define p2p(x) ((((x) * (x))))

mt _x1, ty1, _x2, _y2, answ;
mt n, t[2];
char s[N];

bool f(mt cnt) {
	mt x = _x1, y = ty1;
	rep(0, n, i) {
		mt d = (cnt / n + (i < (cnt % n)));
		if (s[i] == 'L') x -= d;
		else if (s[i] == 'R') x += d;
		else if (s[i] == 'U')y += d;
		else y -= d;
	}

	return abs(x - _x2) + abs(y - _y2) <= cnt;
}

mt bs() {
	mt u = 1e18;
	mt l = -1, r = u;
	while (r - l > 1) {
		mt md = l + r >> 1;
		if (f(md)) r = md;
		else l = md;
	}
	if (r == u) return -1;
	return r;
}

int main(void) {
#ifdef _DEBUG
	freopen("in.txt", "r", stdin);
#endif
	scanf("%lld %lld\n%lld %lld", &_x1, &ty1, &_x2, &_y2);
	scanf("%lld", &n);
	scanf("%s", s);
	t[0] = abs(_x2 - _x1);
	t[1] = abs(_y2 - ty1);

	//bool ok = f(1000000000);
	//d = abs(_x2 - _x1) + abs(_y2 - ty1);
	printf("%lld\n", bs());

	return 0;
}


#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <cstring>
#include <iterator>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <chrono>
#include <assert.h>
#include <memory>
#include <cstddef>
#include <iterator>

#pragma comment(linker, "/stack:20000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

using namespace std;
typedef long long mt;
typedef double fl;

template<typename T>
constexpr mt infValue = std::is_same<T, int>::value ? 2000100007 : 8600000000000000007ll;
template<typename T>
constexpr mt maxValue = std::is_same<T, int>::value ? 1000000007 : 1000000000000000001ll;

#define rep(a, b, i) for(mt i = a; i < b; ++i)
#define repe(a, b, i) for(mt i = a; i <= (b); ++i)
#define repd(a, b, i) for(mt i = a; i > b; --i)
#define repde(a, b, i) for(mt i = a; i >= b; --i)

const mt INF = infValue<mt>;
const long long MOD = 1000000007ll;//998244353ll;
const double EPS = 1e-6;
const mt MAX = maxValue<mt>;
using pr = pair<mt, mt>;

#define N 300010
#define K 5
#define P 3
#define M (N * N)
#define p2(x) ((((x) * (x)) % (MOD)))
#define mxy(x, y) ((((x) * (y)) % (MOD)))
#define p2p(x) ((((x) * (x))))

mt _x1, ty1, _x2, _y2, answ;
mt n, t[2];
char s[N];

mt dec(mt& a) {
	if (!a) return 0;
	if (a > 0) --a;
	else ++a;
	return 1;
}

void build() {
	rep(0, n, i) {
		if (!t[0] && !t[1]) {
			break;
		}

		if (s[i] == 'L') {
			if (t[0] < 0) {
				dec(t[0]);
				mt x = dec(t[1]);
				if (!x) dec(t[0]);
			}
		}
		else if (s[i] == 'R') {
			if (t[0] > 0) {
				dec(t[0]);
				mt x = dec(t[1]);
				if (!x) dec(t[0]);
			}
		}
		else if (s[i] == 'U') {
			if (t[1] > 0) {
				dec(t[1]);
				mt x = dec(t[0]);
				if (!x) dec(t[1]);
			}
		}
		else if (s[i] == 'D') {
			if (t[1] < 0) {
				dec(t[1]);
				mt x = dec(t[0]);
				if (!x) dec(t[1]);
			}
		}

		++answ;
	}
}

int main(void) {
#ifdef _DEBUG
	freopen("in.txt", "r", stdin);
#endif
	scanf("%lld %lld %lld %lld", &_x1, &ty1, &_x2, &_y2);
	scanf("%lld", &n);
	scanf("%s", s);
	t[0] = _x2 - _x1;
	t[1] = _y2 - ty1;

	build();
	if (!t[0] && !t[1]) printf("%lld\n", answ);
	else {
		mt x = (_x2 - _x1) - t[0];
		mt y = (_y2 - ty1) - t[1];
		mt d = min(x ? abs(t[0] / x): 0ll, y ? abs(t[1] / y): 0ll);
		answ += n * d;
		t[0] -= x * d;
		t[1] -= y * d;
		build();

		x = t[0], y = t[1];
		build();
		x -= t[0], y -= t[1];
		d = max(abs(x ? t[0] / x: 0ll), abs(y ? t[1] / y: 0ll));
		answ += n * d;
		t[0] -= x * d;
		t[1] -= y * d;
		build();

		if (!t[0] && !t[1]) printf("%lld\n", answ);
		else puts("-1");
	}

	return 0;
}


#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i,a,b) for (int i = a; i < b; i++)
#define pb push_back
#define all(v) v.begin(), v.end()
#define fi first
#define se second
/*v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v*/

vector<ll> dx, dy;
ll fx, fy, tx, ty, n;
string s;

bool check(ll x)
{
	ll complete = x / n;
	ll total_iter = dx[n - 1] + dy[n - 1] + n;
	ll ans = complete * total_iter;
	ll left = x % n;
	ll total_last = left ? left + dx[left - 1] + dy[left - 1] : 0;
	ll final_ans = ans + total_last;

//	cerr << "x: " << x << ", ans: " << ans << ", total_last: " << total_last << '\n';
	return final_ans >= (tx - fx) + (ty - fy);
}

ll bin_s(ll l, ll r)
{
	if (r - l <= 1)
	{
		if (check(l)) return l;
		if (check(r)) return r;
		return -1;
	}

	ll mid = (l + r) / 2;
	if (check(mid))
	{
		return bin_s(l, mid);
	}
	return bin_s(mid, r);
}

int main()
{
	cin >> fx >> fy >> tx >> ty >> n >> s;

	dx.resize(n);
	dy.resize(n);

	char up = 'U';
	char dw = 'D';
	char lf = 'L';
	char rg = 'R';

	if (tx < fx)
	{
		swap(tx, fx);
		swap(lf, rg);
	}

	if (ty < fy)
	{
		swap(ty, fy);
		swap(up, dw);
	}

	pair<ll, ll> prev = {0, 0};

	rep(i,0,n)
	{
		if (s[i] == up) prev.se++;
		if (s[i] == dw) prev.se--;
		if (s[i] == rg) prev.fi++;
		if (s[i] == lf) prev.fi--;

		dx[i] = prev.fi;
		dy[i] = prev.se;
	//	cerr << "i: " << i << ", dx: " << dx[i] << ", dy: " << dy[i] << '\n';
	}

	ll ans = bin_s(0, 1e18);

	cout << ans;
}


#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i,a,b) for (int i = a; i < b; i++)
#define pb push_back
#define all(v) v.begin(), v.end()
#define fi first
#define se second
/*v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v*/

int main()
{
	ll fx, fy, tx, ty, n;
	string s;
	cin >> fx >> fy >> tx >> ty >> n >> s;
	using pll = pair<ll, ll>;
	vector<pll> v(n);
	pll prev = {0, 0};

	ll sx = (fx > tx ? -1 : 1);
	ll sy = (fy > ty ? -1 : 1);

	map<ll, ll> mx;
	map<ll, ll> my;
	map<ll, ll> m;

	mx[0] = 0;
	my[0] = 0;
	m[0] = 0;

	ll mx_pos = 0;
	for (ll i = 0; i < n; i++)
	{
		if (s[i] == 'U') prev.se++;
		if (s[i] == 'D') prev.se--;
		if (s[i] == 'R') prev.fi++;
		if (s[i] == 'L') prev.fi--;
		v[i] = prev;

		ll dx = sx * prev.fi;
		ll dy = sy * prev.se;

		ll curr;

		curr = dx + dy + i;
		if (m.find(curr) == m.end())
		{
			m[curr] = i + 1;
		}
		else
		{
			m[curr] = min(m[curr], i + 1);
		}

		if (m.find(curr + 1) == m.end())
		{
			m[curr + 1] = i + 1;
		}
		else
		{
			m[curr + 1] = min(m[curr + 1], i + 1);
		}

		curr = dx + i;
		if (mx.find(curr) == mx.end())
		{
			mx[curr] = i + 1;
		}
		else
		{
			mx[curr] = min(mx[curr], i + 1);
		}

		if (mx.find(curr + 1) == mx.end())
		{
			mx[curr + 1] = i + 1;
		}
		else
		{
			mx[curr + 1] = min(mx[curr + 1], i + 1);
		}

		curr = dy + i;
		if (my.find(curr) == my.end())
		{
			my[curr] = i + 1;
		}
		else
		{
			my[curr] = min(my[curr], i + 1);
		}

		if (my.find(curr + 1) == my.end())
		{
			my[curr + 1] = i + 1;
		}
		else
		{
			my[curr + 1] = min(my[curr + 1], i + 1);
		}

		mx_pos = max(mx_pos, dx + dy + i + 1);
	}

	prev.fi *= sx;
	prev.se *= sy;

	ll total_per_move = prev.fi + prev.se + n;

	// target dist
	ll goal = abs(fx - tx) + abs(fy - ty);

	if (total_per_move <= 0 && mx_pos < goal)
	{
		cout << -1;
		return 0;
	}

	ll tmp = goal - mx_pos;

	ll moves_to_make = tmp > 0 ? (tmp / total_per_move + ll(tmp % total_per_move != 0)) : 0;

	ll ans = moves_to_make * n;

	ll last_goal = goal - (moves_to_make * total_per_move);

	cerr << "mx_pos: " << mx_pos << '\n';
	cerr << "total_per_move: " << total_per_move << '\n';
	cerr << "goal: " << goal << '\n';
	cerr << "moves_to_make: " << moves_to_make << '\n';
	cerr << "ans: " << ans << '\n';
	cerr << "last_goal: " << last_goal << '\n';

	bool ass_fail = m.find(last_goal) == m.end();
	if (ass_fail)
	{
		assert(false);
		throw(100500);
	}

	ll last_time = -1;

	if (abs(fx - tx) > abs(fx - ty))
	{
		last_time = max(last_time, mx[last_goal]);
	}
	else (abs(fx - tx) < abs(fx - ty))
	{
		last_time = max(last_time, my[last_goal]);
	}
		last_time = max(last_time, m[last_goal]);
	ll final_ans = ans + last_time;

	cout << final_ans;
}


#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i,a,b) for (int i = a; i < b; i++)
#define pb push_back
#define all(v) v.begin(), v.end()
#define fi first
#define se second
/*v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v*/

int main()
{
	ll fx, fy, tx, ty, n;
	string s;
	cin >> fx >> fy >> tx >> ty >> n >> s;
	using pll = pair<ll, ll>;
	vector<pll> v(n);
	pll prev = {0, 0};

	ll min_x = 0, max_x = 0, min_y = 0, max_y = 0;

	ll sx = (fx > tx ? -1 : 1);
	ll sy = (fy > ty ? -1 : 1);
	map<ll, ll> m;
	m[0] = 0;
	ll mx_pos = 0;
	for (ll i = 0; i < n; i++)
	{
		if (s[i] == 'U') prev.se++;
		if (s[i] == 'D') prev.se--;
		if (s[i] == 'R') prev.fi++;
		if (s[i] == 'L') prev.fi--;
		v[i] = prev;

		ll dx = sx * prev.fi;
		ll dy = sy * prev.se;

		ll curr = dx + dy + i;
		if (m.find(curr) == m.end())
		{
			m[curr] = i + 1;
		}
		else
		{
			m[curr] = min(m[curr], i + 1);
		}

		if (m.find(curr + 1) == m.end())
		{
			m[curr + 1] = i + 1;
		}
		else
		{
			m[curr + 1] = min(m[curr + 1], i + 1);
		}

//		cerr << "m[" << curr << "] = " << m[curr] << '\n';
		mx_pos = max(mx_pos, curr + 1);
	}

	prev.fi *= sx;
	prev.se *= sy;

	ll total_per_move = prev.fi + prev.se + n;

	if (total_per_move <= 0)
	{
		cout << -1;
		return 0;
	}

	// target dist
	ll goal = abs(fx - tx) + abs(fy - ty);

	ll tmp = goal - mx_pos;

	ll moves_to_make = tmp > 0 ? (tmp / total_per_move + ll(tmp % total_per_move != 0)) : 0;

	ll ans = moves_to_make * n;

	ll last_goal = goal - (moves_to_make * total_per_move);

	cerr << "mx_pos: " << mx_pos << '\n';
	cerr << "total_per_move: " << total_per_move << '\n';
	cerr << "goal: " << goal << '\n';
	cerr << "moves_to_make: " << moves_to_make << '\n';
	cerr << "ans: " << ans << '\n';
	cerr << "last_goal: " << last_goal << '\n';

	bool ass_fail = m.find(last_goal) == m.end();
	if (ass_fail)
	{
		assert(false);
		throw(100500);
	}

	cerr << "m[last_goal]: " << m[last_goal] << '\n';

	ll last_time = m[last_goal];

	ll final_ans = ans + last_time;

	cout << final_ans;
}


#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i,a,b) for (int i = a; i < b; i++)
#define pb push_back
#define all(v) v.begin(), v.end()
#define fi first
#define se second
/*v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v*/

vector<ll> dx, dy;
ll fx, fy, tx, ty, n;
string s;

bool check(ll x)
{
	ll complete = x / n;
	ll total_iter = dx[n - 1] + dy[n - 1] + n;
	ll ans = complete * total_iter;
	ll left = x % n;
	ll total_last = left ? left + dx[left - 1] + dy[left - 1] : 0;
	ll final_ans = ans + total_last;

	cerr << "x: " << x << ", ans: " << ans << ", total_last: " << total_last << '\n';
	return final_ans >= (tx - fx) + (ty - fy);
}

ll bin_s(ll l, ll r)
{
	if (r - l <= 1)
	{
		if (check(l)) return l;
		if (check(r)) return r;
		return -1;
	}

	ll mid = (l + r) / 2;
	if (check(mid))
	{
		return bin_s(l, mid);
	}
	return bin_s(mid, r);
}

int main()
{
	cin >> fx >> fy >> tx >> ty >> n >> s;

	dx.resize(n);
	dy.resize(n);

	char up = 'U';
	char dw = 'D';
	char lf = 'L';
	char rg = 'R';

	if (tx < fx)
	{
		swap(tx, fx);
		swap(lf, rg);
	}

	if (ty < fy)
	{
		swap(ty, fy);
		swap(up, dw);
	}

	pair<ll, ll> prev = {0, 0};

	rep(i,0,n)
	{
		if (s[i] == up) prev.se++;
		if (s[i] == dw) prev.se--;
		if (s[i] == rg) prev.fi++;
		if (s[i] == lf) prev.fi--;

		dx[i] = prev.fi;
		dy[i] = prev.se;
		cerr << "i: " << i << ", dx: " << dx[i] << ", dy: " << dy[i] << '\n';
	}

	ll ans = bin_s(0, 1e18);

	cout << ans;
}