wx=[]

wy=[]



def readdata():

    z=[]

    try:

        while True:

            z.append(input())

    except: return z



def nextpath(p, dir0):

    for e in [3,0,1,2]:

        dp = ispath(p, (dir0+e)%4)

        if dp!=[]: break

    return dp



def ispath(p, dir1):

    y,x = p

    dp = []

    if   dir1==0 and y>0            and wy[y-1][x]=="1": dp= 0

    elif dir1==1 and x<len(wx[0])   and wx[y][x]  =="1": dp = 1

    elif dir1==2 and y<len(wy[0])-1 and wy[y][x]  =="1": dp = 2

    elif dir1==3 and x>0            and wx[y][x-1]=="1": dp = 3

    return dp



def f0037():

    p =[0,0]

    dp = 1

    msg = []

    while True:

        dp = nextpath(p, dp)

        p[0]+=[-1,0,1,0][dp]

        p[1]+=[0,1,0,-1][dp]

        msg.append("URDL"[dp])

        if p==[0,0]: break 

    return msg



z = readdata()

wx = z[0::2]

wy = z[1::2]

msg = f0037()    

print("".join(msg))
wx=[]

wy=[]



def readdata():

    z=[]

    try:

        while True:

            z.append(input())

    except: return z



def nextpath(p,dir0):

    for e in [3,0,1,2]:

        d = (dir0+e)%4

        if ispath(p,d): return d

    return None



def ispath(p,d):

    y,x = p

    f=""

    try:

        if   d==0 and y>0: f = wy[y-1][x]

        elif d==1 and x<len(wy): f = wx[y][x]

        elif d==2 and y<len(wx): f = wy[y][x]

        elif d==3 and x>0: f = wx[y][x-1]

    except: pass

    return f=="1"



def f0037():

    p =[0,0]

    dp = 1

    msg = []

    while True:

        dp = nextpath(p, dp)

        p[0] += [-1,0,1,0][dp]

        p[1] += [0,1,0,-1][dp]

        msg.append("URDL"[dp])

        if p==[0,0]: break

    return "".join(msg)



z = readdata()

wx = z[0::2]

wy = z[1::2]

print(f0037())
wx = []
wy = []


def readdata():
    z = []
    try:
        while True:
            z.append(input())
    except:
        return z


def nextpath(p, dir0):
    for e in [3, 0, 1, 2]:
        dp = ispath(p, (dir0 + e) % 4)
        if dp != []:
            break
    return dp


def ispath(p, dir1):
    y, x = p
    dp = []
    if dir1 == 0 and y > 0 and wy[y - 1][x] == "1":
        dp = 0
    elif dir1 == 1 and x < len(wx[0]) and wx[y][x] == "1":
        dp = 1
    elif dir1 == 2 and y < len(wy[0]) - 1 and wy[y][x] == "1":
        dp = 2
    elif dir1 == 3 and x > 0 and wx[y][x - 1] == "1":
        dp = 3
    return dp


def f0037():
    p = [0, 0]
    dp = 1
    msg = []
    while True:
        dp = nextpath(p, dp)
        p[0] += [-1, 0, 1, 0][dp]
        p[1] += [0, 1, 0, -1][dp]
        msg.append("URDL"[dp])
        if p == [0, 0]:
            break
    return msg


z = readdata()
wx = z[0::2]
wy = z[1::2]
msg = f0037()
print("".join(msg))

wx = []
wy = []


def readdata():
    z = []
    try:
        while True:
            z.append(input())
    except:
        return z


def nextpath(p, dir0):
    for e in [3, 0, 1, 2]:
        d = (dir0 + e) % 4
        if ispath(p, d):
            return d
    return None


def ispath(p, d):
    y, x = p
    f = ""
    try:
        if d == 0 and y > 0:
            f = wy[y - 1][x]
        elif d == 1 and x < len(wy):
            f = wx[y][x]
        elif d == 2 and y < len(wx):
            f = wy[y][x]
        elif d == 3 and x > 0:
            f = wx[y][x - 1]
    except:
        pass
    return f == "1"


def f0037():
    p = [0, 0]
    dp = 1
    msg = []
    while True:
        dp = nextpath(p, dp)
        p[0] += [-1, 0, 1, 0][dp]
        p[1] += [0, 1, 0, -1][dp]
        msg.append("URDL"[dp])
        if p == [0, 0]:
            break
    return "".join(msg)


z = readdata()
wx = z[0::2]
wy = z[1::2]
print(f0037())

-        dp = ispath(p, (dir0 + e) % 4) -        if dp != []: -            break -    return dp +        d = (dir0 + e) % 4 +        if ispath(p, d): +            return d +    return None -def ispath(p, dir1): +def ispath(p, d): -    dp = [] -    if dir1 == 0 and y > 0 and wy[y - 1][x] == "1": -        dp = 0 -    elif dir1 == 1 and x < len(wx[0]) and wx[y][x] == "1": -        dp = 1 -    elif dir1 == 2 and y < len(wy[0]) - 1 and wy[y][x] == "1": -        dp = 2 -    elif dir1 == 3 and x > 0 and wx[y][x - 1] == "1": -        dp = 3 -    return dp +    f = "" +    try: +        if d == 0 and y > 0: +            f = wy[y - 1][x] +        elif d == 1 and x < len(wy): +            f = wx[y][x] +        elif d == 2 and y < len(wx): +            f = wy[y][x] +        elif d == 3 and x > 0: +            f = wx[y][x - 1] +    except: +        pass +    return f == "1" -    return msg +    return "".join(msg) -msg = f0037() -print("".join(msg)) +print(f0037())