Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 30 09:02:42 2018
ABC111D
@author: maezawa
"""
import sys
input = sys.stdin.readline

n = int(input())
xy = []
for _ in range(n):
    xy.append(list(map(int, input().split())))
    
#print(xy)
m = 1
parity = sum(xy[0])%2
far = 0
for point in xy:
    length = sum(list(map(abs, point)))
    if length > far:
        far = length
    if length%2 != parity:
        m = -1

if m == -1:
    print(m)
else:
    if parity == 0:
        ds = [1,1]
    else:
        ds = [1,1,1]
    i = 1
    while i**2 < far:
        ds.append(2**i)
        i += 1
    ds.append(2**i)
    ds.reverse()
    print(len(ds))
    print(*ds, sep=' ')
    for point in xy:
        direction = ''
        point0 = [0,0]
        for arm in ds:
            x = point[0] - point0[0]
            y = point[1] - point0[1]
            if abs(x) > abs (y):
                if x > 0:
                    direction += 'R'
                    point0[0] += arm
                else:
                    direction += 'L'
                    point0[0] -= arm
            else:
                if y > 0:
                    direction += 'U'
                    point0[1] += arm
                else:
                    direction += 'D'
                    point0[1] -= arm
            #print(point0)
        print(direction)
                    
       

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 30 09:02:42 2018
ABC111D
@author: maezawa
"""
import sys
input = sys.stdin.readline

n = int(input())
xy = []
for _ in range(n):
    xy.append(list(map(int, input().split())))
    
#print(xy)
m = 1
parity = sum(xy[0])%2
far = 0
for point in xy:
    length = sum(list(map(abs, point)))
    if length > far:
        far = length
    if length%2 != parity:
        m = -1

if m == -1:
    print(m)
else:
    if parity == 0:
        ds = [1,1]
    else:
        ds = [1,1,1]
    i = 1
    while 2**i < far:
        ds.append(2**i)
        i += 1
    ds.append(2**i)
    ds.reverse()
    print(len(ds))
    print(*ds, sep=' ')
    for point in xy:
        direction = ''
        point0 = [0,0]
        for arm in ds:
            x = point[0] - point0[0]
            y = point[1] - point0[1]
            if abs(x) > abs (y):
                if x > 0:
                    direction += 'R'
                    point0[0] += arm
                else:
                    direction += 'L'
                    point0[0] -= arm
            else:
                if y > 0:
                    direction += 'U'
                    point0[1] += arm
                else:
                    direction += 'D'
                    point0[1] -= arm
            #print(point0)
        print(direction)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 30 09:02:42 2018
ABC111D
@author: maezawa
"""
import sys
input = sys.stdin.readline

n = int(input())
xy = []
for _ in range(n):
    xy.append(list(map(int, input().split())))
    
#print(xy)
m = 1
parity = sum(xy[0])%2
for point in xy:
    if sum(point)%2 != parity:
        m = -1
        break
if m == -1:
    print(m)
else:
    far = 0
    for point in xy:
        length = sum(list(map(abs, point)))
        if length > far:
            far = length
    if parity == 0:
        ds = [1,1]
    else:
        ds = [1,1,1]
    i = 1
    while i**2 < far:
        ds.append(2**i)
        i += 1
    ds.append(2**i)
    ds.reverse()
    print(len(ds))
    print(*ds, sep=' ')
    for point in xy:
        direction = ''
        point0 = [0,0]
        for arm in ds:
            x = point[0] - point0[0]
            y = point[1] - point0[1]
            if abs(x) > abs (y):
                if x > 0:
                    direction += 'R'
                    point0[0] += arm
                else:
                    direction += 'L'
                    point0[0] -= arm
            else:
                if y > 0:
                    direction += 'U'
                    point0[1] += arm
                else:
                    direction += 'D'
                    point0[1] -= arm
            #print(point0)
        print(direction)
                    
            
    
        
        

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 30 09:02:42 2018
ABC111D
@author: maezawa
"""
import sys
input = sys.stdin.readline

n = int(input())
xy = []
for _ in range(n):
    xy.append(list(map(int, input().split())))
    
#print(xy)
m = 1
parity = sum(xy[0])%2
far = 0
for point in xy:
    length = sum(list(map(abs, point)))
    if length > far:
        far = length
    if length%2 != parity:
        m = -1

if m == -1:
    print(m)
else:
    if parity == 0:
        ds = [1,1]
    else:
        ds = [1,1,1]
    i = 1
    while 2**i < far:
        ds.append(2**i)
        i += 1
    ds.append(2**i)
    ds.reverse()
    print(len(ds))
    print(*ds, sep=' ')
    for point in xy:
        direction = ''
        point0 = [0,0]
        for arm in ds:
            x = point[0] - point0[0]
            y = point[1] - point0[1]
            if abs(x) > abs (y):
                if x > 0:
                    direction += 'R'
                    point0[0] += arm
                else:
                    direction += 'L'
                    point0[0] -= arm
            else:
                if y > 0:
                    direction += 'U'
                    point0[1] += arm
                else:
                    direction += 'D'
                    point0[1] -= arm
            #print(point0)
        print(direction)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 30 09:02:42 2018
ABC111D
@author: maezawa
"""

n = int(input())
xy = []
for _ in range(n):
    xy.append(list(map(int, input().split())))
    
#print(xy)
m = 1
parity = sum(xy[0])%2
for point in xy:
    if sum(point)%2 != parity:
        m = -1
        break
if m == -1:
    print(m)
else:
    far = 0
    for point in xy:
        length = sum(list(map(abs, point)))
        if length > far:
            far = length
    if parity == 0:
        ds = [1,1]
    else:
        ds = [1,1,1]
    i = 1
    while i**2 < far:
        ds.append(2**i)
        i += 1
    ds.append(2**i)
    ds.reverse()
    print(len(ds))
    print(*ds, sep=' ')
    for point in xy:
        direction = ''
        point0 = [0,0]
        for arm in ds:
            x = point[0] - point0[0]
            y = point[1] - point0[1]
            if abs(x) > abs (y):
                if x > 0:
                    direction += 'R'
                    point0[0] += arm
                else:
                    direction += 'L'
                    point0[0] -= arm
            else:
                if y > 0:
                    direction += 'U'
                    point0[1] += arm
                else:
                    direction += 'D'
                    point0[1] -= arm
            #print(point0)
        print(direction)
                    

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 30 09:02:42 2018
ABC111D
@author: maezawa
"""
import sys
input = sys.stdin.readline

n = int(input())
xy = []
for _ in range(n):
    xy.append(list(map(int, input().split())))
    
#print(xy)
m = 1
parity = sum(xy[0])%2
far = 0
for point in xy:
    length = sum(list(map(abs, point)))
    if length > far:
        far = length
    if length%2 != parity:
        m = -1

if m == -1:
    print(m)
else:
    if parity == 0:
        ds = [1,1]
    else:
        ds = [1,1,1]
    i = 1
    while 2**i < far:
        ds.append(2**i)
        i += 1
    ds.append(2**i)
    ds.reverse()
    print(len(ds))
    print(*ds, sep=' ')
    for point in xy:
        direction = ''
        point0 = [0,0]
        for arm in ds:
            x = point[0] - point0[0]
            y = point[1] - point0[1]
            if abs(x) > abs (y):
                if x > 0:
                    direction += 'R'
                    point0[0] += arm
                else:
                    direction += 'L'
                    point0[0] -= arm
            else:
                if y > 0:
                    direction += 'U'
                    point0[1] += arm
                else:
                    direction += 'D'
                    point0[1] -= arm
            #print(point0)
        print(direction)