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

typedef vector<long long> vi;
typedef unordered_set<long long> usi;
typedef set<long long> osi;
typedef vector<pair<long long,long long>> vpi;
typedef long long ll;

#define pb push_back
#define popb pop_back
#define mp make_pair

#define read(a) ll a; cin>>a;
#define pt(a) cout << a << "\t"
#define pl(a) cout << a << "\n"

#define fori(i,n) for(ll i = 0; i < n; i++)
#define fori2(i,m,n) for (ll i = m; i <= n; i++)
#define ford(i,n) for (ll i = n - 1; i >= 0; i--)
#define ford2(i,m,n) for (ll i = m; i >=n; i--)    
#define iter(s) for(auto it:s)

#define mod 1000000007
#define PI 3.1415926535897932384626433832

/*
//a raised to the power n
ll pow1(ll a,ll n)
{
    if(n==0)
    {
        return 1;
    }
    else
    {
        return a*pow1(a,n-1);
    }
}
*/

/*
//total sum of a vector
ll sum1(vi v)
{
    ll sum = 0;
    for(int i=0 ; i<v.size() ; i++)
    {
        sum = sum + v[i];
    }
    return sum;
}
*/

/*
//printing contents of a vector
void printv(vi v)
{
    for(auto it=v.begin(); it!=v.end() ; it++)
    {
        cout<<*it<<"\t";
    }
    cout<<"\t";
}
*/

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	// your code goes here
	int t = 1;
	//read(t);
	while(t--)
	{
	    // your code goes here
	    ll suml = 0;
	    
	    read(n);
	    
	    ll a[n];
	    ll m[n] = {0};
	    ll s[n] = {0};
	    ll st[n] = {0};
	    
	    fori(i,n)
	    {
	        cin>>a[i];
	        
	        if(i==0)    m[i] = a[i];
	        else    m[i] = max(m[i-1],a[i]);
	        
	        if(i==0)    s[i] = a[i];
	        else    s[i] = s[i-1] + a[i];
	    }
	    
	    st[0] = s[0];
	    
	    fori2(i,1,n-1)
	    {
	        st[i] = st[i-1] + s[i];
	    }
	    
	    
	    fori(i,n)
	    {
	        pl((st[i] + m[i]*(i+1)));
	    }
	    
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define REP(i, n) for (int i=1; i<=(int)(n); i++)
#define FOR(i, n, m) for (int i=(n); i<=(int)(m); i++)
#define ll long long
const ll INF=1LL<<60;
const double pi=3.1415926535;

int main() {
    vector<vector<int>> dp(900, vector<int>(900));
    vector<int> vec_output;

    rep(i, 1000) {

        //入力
        vector<int> input(4);
        rep(j, 4) cin >> input.at(j);

        //通った道
        vector<int> usei(0), usej(0);
        usei.push_back(input.at(0));
        usej.push_back(input.at(1));

        int x = input.at(1);
        int y = input.at(0);
        int xplus = 0;
        int yplus = 0;
        if (x < input.at(3)) xplus = 1;
        if (x > input.at(3)) xplus = -1;
        if (y < input.at(2)) yplus = 1;
        if (y > input.at(2)) yplus = -1;
        bool X = false;

        //経路探索
        while (x != input.at(3)) {
            //ｘの残りをうめる
            if (y == input.at(2)) {
                while (x != input.at(3)) {
                    x += xplus;
                    usei.push_back(y);
                    usej.push_back(x);
                    cout << (xplus == 1 ? "R" : "L") << flush;
                }
                break;
            }

            //探索済みか調べる
            if (dp.at(y*30 + x).at(y*30 + x+xplus) == 0 && dp.at(y*30 + x).at((y+yplus)*30 + x) == 0) {
                X = X;
            } else if (dp.at(y*30 + x).at(y*30 + x+xplus) == 0) {
                X = true;
            } else if (dp.at(y*30 + x).at((y+yplus)*30 + x) == 0) {
                X = false;
            }
            //近い方を調べる
            if (dp.at(y*30 + x).at(y*30 + x+xplus) < dp.at(y*30 + x).at((y+yplus)*30 + x)) {
                X = true;
            } else if (dp.at(y*30 + x).at(y*30 + x+xplus) > dp.at(y*30 + x).at((y+yplus)*30 + x)) {
                X = false;
            } else {
                X = !X;
            }

            if (X) {
                x += xplus;
                usei.push_back(y);
                usej.push_back(x);
                cout << (xplus == 1 ? "R" : "L") << flush;
            } else {
                y += yplus;
                usei.push_back(y);
                usej.push_back(x);
                cout << (yplus == 1 ? "D" : "U") << flush;
            }
        }
        
        //yの残りをうめる
        while (y != input.at(2)) {
            y += yplus;
            usei.push_back(y);
            usej.push_back(x);
            cout << (yplus == 1 ? "D" : "U") << flush;
        }
        cout << endl;

        //入力
        ll output;
        cin >> output;

        //点数の平均を計算
        vec_output.push_back(output);
        ll sum = 0;
        for (ll a : vec_output) {
            sum += a;
        }
        ll ave = sum / vec_output.size();
        output -= ave;
        output *= 60;
        int size = usei.size();

        rep(j, usei.size()-1) {
            int a = usei.at(j);
            int b = usej.at(j);
            int c = usei.at(j+1);
            int d = usej.at(j+1);
            //cout << a*30+b << " " << c*30+d << endl;
            dp.at(a*30+b).at(c*30+d) += output / size;
            dp.at(c*30+d).at(a*30+b) += output / size;
        }

        /*rep(j, 29) {
            rep(k, 29) {
                cout << " " << dp.at(j*30+k).at(j*30+k+1);
            }
            cout << endl;
            rep(k, 30) {
                cout << dp.at(j*30+k).at((j+1)*30+k) << " ";
            }
            cout << endl;
        }*/
    }
}
