Problem:
Score : 300 points

Problem Statement

Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.

Currently, he is located at the point (sx,sy). In each second, he can move up, down, left or right by a distance of 1.

Here, both the x- and y-coordinates before and after each movement must be integers.

He will first visit the point (tx,ty) where sx < tx and sy < ty, then go back to the point (sx,sy), then visit the point (tx,ty) again, and lastly go back to the point (sx,sy).

Here, during the whole travel, he is not allowed to pass through the same point more than once, except the points (sx,sy) and (tx,ty).

Under this condition, find a shortest path for him.

Constraints

-1000 ≤ sx < tx ≤ 1000

-1000 ≤ sy < ty ≤ 1000

sx,sy,tx and ty are integers.

Input

The input is given from Standard Input in the following format:

sx sy tx ty

Output

Print a string S that represents a shortest path for Dolphin.

The i-th character in S should correspond to his i-th movement.

The directions of the movements should be indicated by the following characters:

U: Up

D: Down

L: Left

R: Right

If there exist multiple shortest paths under the condition, print any of them.

Sample Input 1

0 0 1 2

Sample Output 1

UURDDLLUUURRDRDDDLLU

One possible shortest path is:

Going from (sx,sy) to (tx,ty) for the first time: (0,0) → (0,1) → (0,2) → (1,2)

Going from (tx,ty) to (sx,sy) for the first time: (1,2) → (1,1) → (1,0) → (0,0)

Going from (sx,sy) to (tx,ty) for the second time: (0,0) → (-1,0) → (-1,1) → (-1,2) → (-1,3) → (0,3) → (1,3) → (1,2)

Going from (tx,ty) to (sx,sy) for the second time: (1,2) → (2,2) → (2,1) → (2,0) → (2,-1) → (1,-1) → (0,-1) → (0,0)

Sample Input 2

-2 -2 1 1

Sample Output 2

UURRURRDDDLLDLLULUUURRURRDDDLLDL

Solution in Rust (1.15.1) (judge verdict: Accepted)

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}


fn add(x: i64, y: i64) -> i64 {
    if x.is_negative() {
        x - y
    } else {
        x + y
    }
}

fn shift(step: i64, vertical: bool) -> Vec<char> {
    let mut res = Vec::with_capacity(step.abs() as usize);
    if !vertical {
        if step > 0 {
            for _ in 0..step {
                res.push('R');
            }
        } else {
            for _ in 0..step.abs() {
                res.push('L');
            }
        }
    }  else {
        if step > 0 {
            for _ in 0..step {
                res.push('U');
            }
        } else {
            for _ in 0..step.abs() {
                res.push('D');
            }
        }
    }
    res
}


#[allow(dead_code)]
fn solve(sx: i64, sy: i64, tx: i64, ty: i64) -> String {
    let tx = tx - sx;
    let ty = ty - sy;
    let mut res: Vec<char> = Vec::new();
    res.extend_from_slice(&shift(ty, true));
    res.extend_from_slice(&shift(tx, false));
    res.extend_from_slice(&shift(-ty, true));
    res.extend_from_slice(&shift(-tx, false));

    res.extend_from_slice(&shift(-tx/tx.abs(), false));
    res.extend_from_slice(&shift(add(ty, 1), true));
    res.extend_from_slice(&shift(add(tx, 1), false));
    res.extend_from_slice(&shift(-ty/ty.abs(), true));

    res.extend_from_slice(&shift(tx/tx.abs(), false));
    res.extend_from_slice(&shift(add(-ty, 1), true));
    res.extend_from_slice(&shift(add(-tx, 1), false));
    res.extend_from_slice(&shift(ty/ty.abs(), true));
    res.into_iter().collect()
}

#[allow(dead_code)]
fn main() {
    input!{
        sx: i64,
        sy: i64,
        tx: i64,
        ty: i64,
    }
    println!("{}", solve(sx, sy, tx, ty));
}