Santa Claus is the first who came to the Christmas Olympiad, and he is going to be the first to take his place at a desk! In the classroom there are n lanes of m desks each, and there are two working places at each of the desks. The lanes are numbered from 1 to n from the left to the right, the desks in a lane are numbered from 1 to m starting from the blackboard. Note that the lanes go perpendicularly to the blackboard, not along it (see picture).

The organizers numbered all the working places from 1 to 2nm. The places are numbered by lanes (i. e. all the places of the first lane go first, then all the places of the second lane, and so on), in a lane the places are numbered starting from the nearest to the blackboard (i. e. from the first desk in the lane), at each desk, the place on the left is numbered before the place on the right. [Image] The picture illustrates the first and the second samples. 

Santa Clause knows that his place has number k. Help him to determine at which lane at which desk he should sit, and whether his place is on the left or on the right!


-----Input-----

The only line contains three integers n, m and k (1 ≤ n, m ≤ 10 000, 1 ≤ k ≤ 2nm) — the number of lanes, the number of desks in each lane and the number of Santa Claus' place.


-----Output-----

Print two integers: the number of lane r, the number of desk d, and a character s, which stands for the side of the desk Santa Claus. The character s should be "L", if Santa Clause should sit on the left, and "R" if his place is on the right.


-----Examples-----
Input
4 3 9

Output
2 2 L

Input
4 3 24

Output
4 3 R

Input
2 4 4

Output
1 2 R



-----Note-----

The first and the second samples are shown on the picture. The green place corresponds to Santa Claus' place in the first example, the blue place corresponds to Santa Claus' place in the second example.

In the third sample there are two lanes with four desks in each, and Santa Claus has the fourth place. Thus, his place is in the first lane at the second desk on the right.

Difficulty: EASY
Tags: Mathematics

Implementation

Starter code:

Solutions:
(n, m, k) = map(int, input().split())
q = m * 2
a = 1
while True:
	if k <= q:
		break
	a += 1
	q += m * 2
print(a, end=' ')
s = q - m * 2 + 1
c = 1
while True:
	if k == s or k == s + 1:
		print(c, end=' ')
		break
	s += 2
	c += 1
print('R' if k % 2 == 0 else 'L')


(n, m, k) = map(int, input().split())
a = []
p = 1
for i in range(m):
	a += [[p, p + 1]]
	p += 2
p -= 1
x = -(-k // p)
if k % 2 == 0:
	z = 'R'
else:
	z = 'L'
if k % p == 0:
	y = m
else:
	for i in range(m):
		if k % p in a[i]:
			y = i + 1
			break
print(x, y, z)


(n, m, k) = map(int, input().split())
x = (k - 1) // 2
r = x // m + 1
d = x % m + 1
if k % 2 == 0:
	s = 'R'
else:
	s = 'L'
print(r, d, s)


(n, m, k) = map(int, input().split())
x = k // (m * 2) + (k % (m * 2) + m * 2 - 1) // (m * 2)
print(x, (k - (x - 1) * m * 2) // 2 + ((k - (x - 1) * m * 2) % 2 + 1) // 2, '', end='')
if k % 2 == 0:
	print('R')
else:
	print('L')


from math import ceil
(n, m, k) = [int(i) for i in input().split()]
a = k % (2 * m)
if a == 0:
	a = 2 * m
print(ceil(k / (2 * m)), (a + 1) // 2, 'RL'[k % 2])


import math
(n, m, k) = map(int, input().split())
r = math.ceil(k / (m * 2))
d = math.ceil((k - (r - 1) * m * 2) / 2)
if k % 2:
	s = 'L'
else:
	s = 'R'
print(r, d, s)


(a, b, c) = map(int, input().split())
k = c // (2 * b) + 1
if c % (2 * b) == 0:
	k -= 1
h = 'R'
if c % 2 == 1:
	h = 'L'
j = c % (2 * b)
if j == 0:
	r = b
else:
	r = j // 2 + j % 2
print(k, r, h)


from math import ceil
(n, m, k) = input().split()
n = int(n)
m = int(m)
k = int(k)
in0neRow = 2 * m
row = ceil(k / float(in0neRow))
d = ceil((k - (row - 1) * in0neRow) / 2)
print(row, d, end=' ')
if k % 2 == 0:
	print('R')
else:
	print('L')


import math
(n, m, k) = [int(s) for s in input().split()]
print(math.ceil(k / (2 * m)), math.ceil((k - (math.ceil(k / (2 * m)) - 1) * m * 2) / 2), end=' ')
if k % 2:
	print('L')
else:
	print('R')


(n, m, k) = list(map(int, input().split()))
r1 = 0
for i in range(1, n + 1):
	if r1 < k and k <= 2 * m * i:
		r = i
		break
	else:
		r1 = 2 * m * i
if (k - 2 * (r - 1) * m) % 2 == 0:
	s = 'R'
	d = (k - 2 * (r - 1) * m - 2) // 2 + 1
else:
	s = 'L'
	d = (k - 2 * (r - 1) * m - 1) // 2 + 1
print(r, d, s)


(b, c) = map(int, input().split()[1:])
from math import ceil as z
k = z(c / (b * 2))
print(k, z((c - (k - 1) * (2 * b)) / 2), ['R', 'L'][c % 2])


(n, m, k) = map(int, input().split())
s = k % 2
r = (k - 1) // (2 * m)
d = r * m + 1
i = d * 2
d = 1
if s == 1:
	i -= 1
while i != k:
	i += 2
	d += 1
if s == 1:
	s = 'L'
else:
	s = 'R'
print(r + 1, d, s)


(c, r, k) = [int(x) for x in input().split()]
zerobasek = k - 1
singlenum = zerobasek // 2
zerobasec = singlenum // r
zerobaser = singlenum % r
print(zerobasec + 1, end=' ')
print(zerobaser + 1, end=' ')
if k % 2 == 0:
	print('R')
else:
	print('L')


from math import ceil
X = list(map(int, input().split()))
Lane = ceil(X[2] / (X[1] * 2))
Desk = ceil((X[2] - (Lane - 1) * X[1] * 2) / 2)
print(str(Lane), str(Desk), end=' ')
print('L' if X[2] % 2 != 0 else 'R')


(q, w, e) = map(int, input().split())
if e % 2 == 1:
	c = 'L'
else:
	c = 'R'
e = (e + 1) // 2
x = e % w
if x == 0:
	x = w
if e % w == 0:
	z = e // w
else:
	z = e // w + 1
print(z, x, c)


def solution(l1):
	(n, m) = (l1[0], l1[1])
	k = l1[2]
	ans1 = int(k / (2 * m)) + (k % (2 * m) != 0)
	ans2 = int((k - (ans1 - 1) * (2 * m)) / 2) + ((k - (ans1 - 1) * (2 * m)) % 2 != 0)
	if k % 2:
		side = 'L'
	else:
		side = 'R'
	return str(ans1) + ' ' + str(ans2) + ' ' + side

def answer():
	l1 = [int(x) for x in input().split()]
	print(solution(l1))
answer()


def santa(n, m, k):
	direction = 'R'
	if k & 1 == 1:
		direction = 'L'
	lane = 2
	while True:
		if k <= m * lane:
			prev = m * (lane - 2) + 1
			desk = 1
			while True:
				if k == prev or k == prev + 1:
					break
				desk += 1
				prev += 2
			break
		lane += 2
	lane //= 2
	print(lane, desk, direction)
(n, m, k) = list(map(int, input().split()))
santa(n, m, k)


s = list(map(int, input().split()))
n = s[0]
m = s[1]
k = s[2]
kolvr = 2 * m
if k % kolvr == 0:
	r = k // kolvr
else:
	r = k // kolvr + 1
nachr = 2 * m * (r - 1)
i = k - nachr
if i % 2 == 0:
	d = i // 2
else:
	d = i // 2 + 1
print(r, end=' ')
print(d, end=' ')
if k % 2 == 0:
	print('R')
else:
	print('L')


(n, m, k) = map(int, input().split())
d = m * 2
k -= 1
print(k // d + 1, k % d // 2 + 1, 'LR'[k % d % 2])


(n, m, k) = list(map(int, input().split()))
dr = m * 2
if k <= dr:
	if k % 2 == 0:
		n1 = 1
		m1 = k // 2
		lr = 'R'
	else:
		n1 = 1
		m1 = k // 2 + 1
		lr = 'L'
elif k % dr == 0:
	n1 = k // dr
	m1 = m
	lr = 'R'
else:
	n1 = k // dr + 1
	if k % 2 == 0:
		m1 = (k - (n1 - 1) * dr) // 2
		lr = 'R'
	else:
		m1 = (k - (n1 - 1) * dr) // 2 + 1
		lr = 'L'
print(n1, m1, lr)


(n, m, n) = map(int, input().split())
p = (n - 1) // 2
y = p // m + 1
x = p % m + 1
if n % 2 == 0:
	print(y, x, 'R')
if n % 2 == 1:
	print(y, x, 'L')


import math
(n, m, k) = map(int, input().split())
l = math.ceil(k / (2 * m))
se = math.ceil((k - (l - 1) * 2 * m) / 2)
print(l, se, end=' ')
if k % 2 == 0:
	print('R')
else:
	print('L')


(n, m, k) = map(int, input().split())
num = (k - 1) // 2
row = num // m + 1
col = num % m + 1
print(row, col, 'L' if k % 2 else 'R')


(n, m, k) = map(int, input().split())
for i in range(1, n + 1):
	if k % 2 == 0:
		j = k // 2 - m * (i - 1)
		if 1 <= j and j <= m:
			print('{} {} R'.format(i, j))
			exit()
	else:
		j = (k + 1) // 2 - m * (i - 1)
		if 1 <= j and j <= m:
			print('{} {} L'.format(i, j))
			exit()


def get_place(rows, dpr, k):
	k -= 1
	dn = k // 2
	return (dn // dpr + 1, dn % dpr + 1, 'LR'[k % 2])

def m():
	print(*get_place(*map(int, input().split(' '))))
m()


IL = lambda : list(map(int, input().split()))
IS = lambda : input().split()
I = lambda : int(input())
S = lambda : input()
(n, m, k) = IL()
print((k - 1) // (2 * m) + 1, (k - 1) % (2 * m) // 2 + 1, 'L' if k % 2 else 'R')


(n, m, k) = map(int, input().split())
tot = 2 * n * m
from math import ceil
z = ceil(k / 2)
lane = ceil(z / m)
desk = z % m
if desk == 0:
	desk = m
print(lane, desk, end=' ')
if k % 2:
	print('L')
else:
	print('R')


(a, b, c) = map(int, input().split())
t = 0
r = 0
for i in range(a):
	if c <= b * (i + 1) * 2:
		t = c - i * b * 2
		r = int(t / 2)
		if c % 2 == 1:
			r = r + 1
		print(i + 1, r, end=' ')
		if c % 2 == 1:
			print('L')
			break
		else:
			print('R')
			break


(n, m, k) = map(int, input().split())
print((k - 1) // (2 * m) + 1, (k - 1) % (2 * m) // 2 + 1, 'L' if k % 2 else 'R')


(n, m, k) = map(int, input().split())
if k % 2 == 0:
	p = k // 2
else:
	p = k // 2 + 1
if p % m == 0:
	r = p // m
else:
	r = p // m + 1
p %= m
if p == 0:
	p = m
if k % 2 != 0:
	lr = 'L'
else:
	lr = 'R'
print(r, p, lr)


a = list(map(int, input().split()))
if a[2] % 2 == 0:
	direct = 'R'
else:
	direct = 'L'
min_pos = 1
max_pos = 0
res1 = 0
while max_pos < a[2]:
	max_pos += a[1] * 2
	res1 += 1
	if res1 > 1:
		min_pos += a[1] * 2
res2 = 1
for i in range(min_pos, max_pos + 1):
	if i == a[2]:
		print(res1, res2, direct)
	if i != min_pos and i % 2 == 0:
		res2 += 1


(n, m, k) = [int(i) for i in input().split()]
k -= 1
lane = k // (2 * m) + 1
k -= (lane - 1) * (2 * m)
if k % 2 == 0:
	letter = 'L'
else:
	letter = 'R'
desk = k // 2 + 1
print(lane, desk, letter)


(n, m, k) = map(int, input().split())
if k % 2 == 0:
	side = 'R'
else:
	side = 'L'
p = 0
if k % (m * 2) == 0:
	lane = k // (m * 2)
else:
	lane = k // (m * 2) + 1
while k > m * 2:
	k -= m * 2
desk = (k + 1) // 2
print(lane, desk, side)


(n, m, k) = map(int, input().split())
for i in range(1, n + 1):
	if i * 2 * m >= k:
		for j in range(1, m + 1):
			if (i - 1) * 2 * m + 2 * j >= k:
				if (i - 1) * 2 * m + 2 * j == k:
					print(i, j, 'R')
				if (i - 1) * 2 * m + 2 * j - 1 == k:
					print(i, j, 'L')


(n, m, k) = list(map(int, input().split()))
if k % 2 == 0:
	p = k // 2
	q = p % m
	s = p // m
	if q > 0:
		print(s + 1, q, 'R')
	elif q == 0:
		print(s, m, 'R')
else:
	p = (k + 1) // 2
	q = p % m
	s = p // m
	if q > 0:
		print(s + 1, q, 'L')
	elif q == 0:
		print(s, m, 'L')


import math
line = input()
(lane, desk, k) = [int(x) for x in line.split()]
laneno = math.ceil(k / (2 * desk))
deskno = k % (2 * desk)
if deskno == 0:
	deskno = desk
else:
	deskno = math.ceil(deskno / 2)
if k % 2 == 0:
	ch = 'R'
else:
	ch = 'L'
print(str(laneno) + ' ' + str(deskno) + ' ' + ch)


(n, m, k) = map(int, input().split())
r = -(-k // (2 * m))
lr = ['R', 'L'][k % 2]
pos = k % (2 * m) if k % (2 * m) else 2 * m
d = (pos + 1) // 2
print(r, d, lr)


_ = input()
_ = list(map(int, _.split()))
l = _[0]
d = _[1]
s = _[2]
lp = (s - 1) // (d * 2) + 1
if s % (d * 2) == 0:
	dp = (d * 2 - 1) // 2 + 1
else:
	dp = (s % (d * 2) - 1) // 2 + 1
if s % 2 == 0:
	lor = 'R'
else:
	lor = 'L'
print(lp, ' ', dp, ' ', lor, end='\n')


st = input()
ans = [0] * 3
(n, m, k) = map(int, st.split())
pl = (k + 1) // 2
ans[0] = (pl - 1) // m + 1
ans[1] = (pl - 1) % m + 1
ans[2] = 'R' if not k % 2 else 'L'
print(*ans)


(n, m, k) = map(int, input().split())

def ceil(a, b):
	return (a + (b - 1)) // b
r = ceil(k, 2 * m)
d = ceil(k - 2 * m * (r - 1), 2)
s = 'R' if k % 2 == 0 else 'L'
print(r, d, s)


(n, m, k) = map(int, input().split())
j = k
p1 = m * 2
if k % p1 == 0:
	l = k // p1
	k -= (k // p1 - 1) * p1
else:
	l = k // p1 + 1
	k -= k // p1 * p1
d = (k + 1) // 2
if j & 1 == 0:
	print(l, d, 'R')
else:
	print(l, d, 'L')


def STR():
	return list(input())

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def MAP2():
	return map(float, input().split())

def LIST():
	return list(map(int, input().split()))

def STRING():
	return input()
import string
import sys
from heapq import heappop, heappush
from bisect import *
from collections import deque, Counter, defaultdict
from math import *
from itertools import permutations, accumulate
dx = [-1, 1, 0, 0]
dy = [0, 0, 1, -1]
(n, m, k) = MAP()
f = k
(r1, r2) = (-1, -1)
lans = []
for i in range(1, n + 1):
	lans.append(2 * m * i)
for i in range(n):
	if lans[i] == k:
		r1 = i + 1
		break
	elif lans[i] > k:
		r1 = i + 1
		break
	else:
		continue
desk = []
for i in range(1, m + 1):
	desk.append(i * 2)
while k > 2 * m:
	k -= 2 * m
if k % 2 != 0:
	k += 1
r2 = bisect_left(desk, k)
r3 = 'L'
if f % 2 == 0:
	r3 = 'R'
print(r1, r2 + 1, r3)


import sys
sys.setrecursionlimit(5000000)

def read(type=int):
	return type(input())

def read_arr(type=int):
	return [type(token) for token in input().split()]
(n, m, k) = read_arr()
k -= 1
l = k // (2 * m)
d = k // 2 % m
side = 'L' if k % 2 == 0 else 'R'
print(l + 1, d + 1, side)


(n, m, k) = map(int, input().split())
r = 0
s = 0
RL = ''
for i in range(1, n + 1):
	if m * i * 2 >= k:
		r = i
		break
k = k - (r - 1) * m * 2
s = int((k + 1) / 2)
if k % 2 == 0:
	RL = 'R'
else:
	RL = 'L'
print(r, s, RL)


(n, m, k) = map(int, input().split())
lan = 1
char = 'L'
if k % 2 == 0:
	char = 'R'
while k > 2 * m:
	k -= 2 * m
	lan += 1
print(str(lan) + ' ' + str((k + 1) // 2) + ' ' + char)


(n, m, k) = map(int, input().split())
if k % 2 == 0:
	l = 'R'
if k % 2 != 0:
	l = 'L'
if k % (2 * m) != 0:
	p = k // (2 * m) + 1
if k % (2 * m) == 0:
	p = k // (2 * m)
t = (k - (p - 1) * (2 * m)) // 2 + (k - (p - 1) * (2 * m)) % 2
print(str(p) + ' ' + str(t) + ' ' + l)


(n, m, d) = map(int, input().split())
i = 1
ii = 1
while i <= 2 * n * m:
	if d >= i and d < i + 2 * m:
		j = i
		jj = 1
		while j < i + 2 * m:
			if j == d or j + 1 == d:
				if d % 2 == 0:
					print(ii, jj, 'R')
					break
				else:
					print(ii, jj, 'L')
					break
			j = j + 2
			jj = jj + 1
		break
	else:
		i = i + 2 * m
		ii = ii + 1


def main():
	(n, m, k) = map(int, input().split())
	(r, k) = divmod(k - 1, m * 2)
	print(r + 1, k // 2 + 1, 'LR'[k & 1])
main()


s = input().split(' ')
n = int(s[0])
m = int(s[1])
k = int(s[2])
if k % 2 == 0:
	k = k / 2
	if k % m == 0:
		p = m
	else:
		p = int(k - k // m * m)
	if k % m == 0:
		r = int(k // m)
	else:
		r = int(k // m + 1)
	print(r, p, 'R')
else:
	k = (k + 1) / 2
	if k % m == 0:
		p = m
	else:
		p = int(k - k // m * m)
	if k % m == 0:
		r = int(k // m)
	else:
		r = int(k // m + 1)
	print(r, p, 'L')


(n, m, k) = list(map(int, input().split()))
position = 'L'
if k % 2 == 0:
	position = 'R'
k //= 2
if position == 'L':
	k += 1
desk = k % m
if desk == 0:
	desk = m
row = (k - desk) // m + 1
print('{} {} {}'.format(row, desk, position))


s1 = input()
li = s1.split()
m = int(li[0])
n = int(li[1])
san = int(li[2])
sumdes = 0
for i in range(m):
	sumdes = sumdes + 2 * n
	if san <= sumdes:
		lane = i + 1
		break
desk = n
for i in range(n):
	if san > sumdes - 2:
		break
	sumdes = sumdes - 2
	desk = desk - 1
if san % 2 == 1:
	taraf = 'L'
else:
	taraf = 'R'
print(lane, desk, taraf)


(n, m, k) = map(int, input().split())
(a, b, c) = (0, 0, 0)
if k % 2 == 0:
	c = 'R'
	k = k // 2
else:
	c = 'L'
	k = (k + 1) // 2
a = k // m + 1
b = k % m
if b == 0:
	b = m
	a -= 1
print(a, b, c)


from math import trunc
(n, m, k) = map(int, input().split())
a = 2 * m
n1 = k // a + (1 if k % a != 0 else 0)
m1 = (k - (n1 - 1) * a) // 2 + (1 if k % 2 != 0 else 0)
print(n1, m1, 'L' if k % 2 else 'R')


import math
[n, m, k] = map(int, input().split())
x = k % (2 * m)
if x == 0:
	print(int(k / (2 * m)), m, 'R')
else:
	row = int(math.ceil(x / 2))
	if x % 2 == 0:
		place = str('R')
	else:
		place = str('L')
	print(int(k / (2 * m) + 1), row, place)


(n, m, k) = (int(i) for i in input().split())
k -= 1
row = int(k / (2 * m)) + 1
col = int(k % (2 * m) / 2) + 1
place = 'R' if k % 2 == 1 else 'L'
print(row, col, place)


strok = input().split()
n = int(strok[0])
m = int(strok[1])
k = int(strok[2])
if k % 2 == 0:
	l_r = 'R'
else:
	l_r = 'L'
if k % 2 == 0:
	a = k // 2
else:
	a = k // 2 + 1
if a % m == 0:
	r = a // m
else:
	r = a // m + 1
d = a - (r - 1) * m
print(r, ' ', d, ' ', l_r)


(n, m, k) = [int(i) for i in input().split()]
if not k % (m * 2):
	r = k // (m * 2)
else:
	r = k // (m * 2) + 1
k1 = k % (m * 2) if k % (m * 2) else m * 2
if k1 % 2:
	s = 'L'
else:
	s = 'R'
if not k1 % 2:
	l = k1 // 2
else:
	l = k1 // 2 + 1
print(r, l, s)


from math import ceil
(l, m, k) = map(int, input().split())
i = 1
while 2 * m * i < k:
	i += 1
lx = list(range(2 * m * (i - 1) + 1, 2 * m * i + 1))
j = lx.index(k) + 1
if j % 2 == 0:
	print(i, j // 2, 'R')
else:
	print(i, ceil(j / 2), 'L')


def kek(k):
	if k % 2:
		return 'L'
	else:
		return 'R'
(n, m, k) = list(map(int, input().split()))
num_of_parta = (k - 1) // 2
r = num_of_parta // m + 1
d = num_of_parta % m + 1
s = kek(k)
print(r, d, s)


import math
(n, m, k) = list(map(int, input().split()))
print(math.ceil(math.ceil(k / 2) / m), end=' ')
if math.ceil(k / 2) % m == 0:
	print(m, end=' ')
else:
	print(math.ceil(k / 2) % m, end=' ')
if k % 2 == 0:
	print('R')
else:
	print('L')


(n, m, k) = [int(x) for x in input().split()]
if k % 2 != 0:
	s = 'L'
else:
	s = 'R'
p = (k - 1) // 2
print(p // m + 1, p % m + 1, s)


a = input().split(' ')
n = int(a[0])
m = int(a[1])
k = int(a[2])
lol = 1
kek = 1
t = False
u = False
side = None
while not t:
	if k <= m * 2 * lol:
		t = True
	else:
		lol += 1
d = m * 2 * lol
r = int(d / (2 * m))
while not u:
	if d - m * 2 + kek * 2 >= k:
		u = True
	else:
		kek += 1
if k % 2 == 0:
	side = 'R'
else:
	side = 'L'
print(str(r), str(kek), side)


(n, m, k) = map(int, input().split(' '))
if k % 2 == 1:
	lr = 'L'
	k += 1
else:
	lr = 'R'
r = int((k / 2 - 1) % m + 1)
c = int((k / 2 - 1) // m + 1)
print(c, r, lr)


(n, m, k) = map(int, input().split())
desk = (k + 1) // 2 % m
if desk == 0:
	desk = m
if k % 2 == 0:
	pos = 'R'
else:
	pos = 'L'
c = 1
row = 1
for i in range(1, n * m + 1, m):
	if i <= (k + 1) // 2 < i + m:
		row = c
		break
	c += 1
print(row, desk, pos)


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))
(col, row, k) = get_int_list()
col_capacity = row * 2
no_of_col = k // col_capacity
if k % col_capacity != 0:
	no_of_col += 1
residue = k % col_capacity
if residue % 2 == 0:
	side = 'R'
else:
	side = 'L'
if residue == 0:
	no_row = row
else:
	no_row = residue // 2 + residue % 2
print(no_of_col, no_row, side)


from math import ceil

def solve(n, m, k):
	t = ceil(k / 2)
	x = m if t % m == 0 else t % m
	y = ceil(t / m)
	p = 'L' if k % 2 == 1 else 'R'
	return f'{y} {x} {p}'

def main():
	(n, m, k) = list(map(int, input().split()))
	print(solve(n, m, k))
main()


s = input().split()
n = int(s[0])
m = int(s[1])
k = int(s[2])
if k % 2 == 0:
	k = int(k / 2)
	a = int(k / m)
	b = k % m
	if b != 0:
		print(a + 1, b, 'R')
	else:
		print(a, m, 'R')
else:
	k = int((k + 1) / 2)
	a = int(k / m)
	b = k % m
	if b != 0:
		print(a + 1, b, 'L')
	else:
		print(a, m, 'L')


(n, m, k) = map(int, input().split())
k -= 1
lane = k // (m * 2)
intermediate = k - lane * (m * 2)
desk = intermediate // 2
print(lane + 1, desk + 1, ['L', 'R'][intermediate % 2])


(n, m, k) = map(int, input().split())
import math
l = math.ceil(k / (m * 2))
if k % (m * 2) == 0:
	d = m
else:
	d = math.ceil(k % (m * 2) / 2)
if k % 2 == 0:
	p = 'R'
else:
	p = 'L'
print(l, d, p)


(n, m, k) = [int(i) for i in input().split()]
if k % 2 == 0:
	s = 'R'
else:
	s = 'L'
r = k // (2 * m)
if k % (2 * m) != 0:
	r += 1
d = k - (r - 1) * 2 * m
if d % 2 != 0:
	d += 1
d = d // 2
print(r, d, s)


(n, m, k) = map(int, input().split())
row = (k + m * 2 - 1) // (m * 2)
table = (k - (m * 2 * (row - 1) + 1)) // 2 + 1
place = ''
if k % 2 == 0:
	place = 'R'
else:
	place = 'L'
print(row, table, place)


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	(a, b, c) = LI()
	x = (c - 1) // (2 * b)
	y = c - 2 * b * x
	z = (y + 1) // 2
	x += 1
	aa = 'L' if c % 2 == 1 else 'R'
	return str(x) + ' ' + str(z) + ' ' + aa
print(main())


(n, m, k) = map(int, input().split())
print((k - 1) // (2 * m) + 1, (k - 1) % (2 * m) // 2 + 1, 'RL'[k % 2])


(n, m, k) = [int(x) for x in input().split(' ')]
biloMest = 0
for row in range(1, n + 1):
	if k > biloMest and k <= 2 * m + biloMest:
		bilo = 1 + biloMest
		for parta in range(1, m + 1):
			if k == bilo or k == bilo + 1:
				if k % 2 == 0:
					print(str(row) + ' ' + str(parta) + ' R')
				else:
					print(str(row) + ' ' + str(parta) + ' L')
			bilo += 2
		break
	biloMest += m * 2


import math
inp1 = list(map(int, input().strip().split()))[:3]
(r, c, val) = (inp1[0], inp1[1], inp1[2])
divi = c * 2
if val % 2:
	val1 = val + 1
	dir1 = 'L'
else:
	val1 = val
	dir1 = 'R'
row = math.ceil(val1 / divi)
rem = val1 % divi
col = rem // 2
if rem == 0:
	col = c
print(row, col, dir1, end=' ')
print()


from math import *
(n, m, k) = [int(x) for x in input().split()]
tmp1 = ceil(k / (2 * m))
tmp2 = k - (tmp1 - 1) * 2 * m
tmp3 = ceil(tmp2 / 2)
if k % 2 == 0:
	print(tmp1, tmp3, 'R')
else:
	print(tmp1, tmp3, 'L')


(n, m, k) = map(int, input().split())
el = m * 2
if k % el == 0:
	lane = k // el
	f = 1
else:
	lane = k // el + 1
	f = 0
w = k - el * (k // el)
if w & 1:
	place = 'L'
	desk = w // 2 + 1
else:
	place = 'R'
	if f == 1:
		desk = m
	else:
		desk = w // 2
print(lane, desk, place)


(n, m, k) = map(int, input().split())
L = int(k / (m + m))
if k % (m + m) != 0:
	L = L + 1
D = (L - 1) * (m + m) + 1
if k % 2 == 0:
	D = D + 1
D = int((k - D) / 2) + 1
st = 'L'
if k % 2 == 0:
	st = 'R'
print(L, D, st)


import math
(n, m, k) = map(int, input().split())
for i in range(1, n + 1):
	if k <= 2 * i * m:
		break
k = k - 2 * (i - 1) * m
j = math.ceil(k / 2)
print(i, j, ['L', 'R'][k % 2 == 0])


(n, m, k) = map(int, input().split())
rad = (k - 1) // (2 * m) + 1
parta = (k - 1) % (2 * m) // 2 + 1
if k % 2 == 0:
	print(rad, parta, 'R')
else:
	print(rad, parta, 'L')


(n, m, k) = tuple(map(int, input().split()))
(x, y) = (0, 0)
x = k // (2 * m)
if x != k / (2 * m):
	x += 1
if k % 2 == 0:
	p = 'R'
	y = 2 * (x - 1) * m + 2
	y = (k - y) // 2 + 1
else:
	p = 'L'
	y = 2 * (x - 1) * m + 1
	y = (k - y) // 2 + 1
print(x, y, p)


import math
(n, m, x) = map(int, input().split())
c = int(math.ceil(x / 2 / m))
r = int(math.ceil((x - (c - 1) * 2 * m) / 2))
if x % 2 == 0:
	print('%d %d R' % (c, r))
else:
	print('%d %d L' % (c, r))


[n, m, k] = [int(x) for x in input().split()]
print(((k + 1) // 2 + m - 1) // m, (k - 1) // 2 % m + 1, 'L' if k % 2 == 1 else 'R')


T_ON = 0
DEBUG_ON = 1
MOD = 998244353

def solve():
	(n, m, k) = read_ints()
	(lane, r) = divmod(k - 1, 2 * m)
	(desk, r) = divmod(r, 2)
	p = 'L' if r == 0 else 'R'
	print(lane + 1, desk + 1, p)

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def First():
	print('First')

def Second():
	print('Second')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def lcm(a, b):
	d = gcd(a, b)
	return a * b // d

def is_even(x):
	return x % 2 == 0

def is_odd(x):
	return x % 2 == 1

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P
main()


sp = input()
list1 = sp.split(' ')
n = int(list1[0])
m = int(list1[1])
k = int(list1[2])
if k % (m * 2) == 0:
	r = k // (m * 2)
	d = m
	if k % 2 == 0:
		s = 'R'
	else:
		s = 'L'
else:
	r = k // (m * 2) + 1
	if k % 2 == 0:
		s = 'R'
		d = int(k % (m * 2) / 2)
	else:
		s = 'L'
		if (k + 1) % (m * 2) == 0:
			d = m
		else:
			d = int((k + 1) % (m * 2) / 2)
print(r, d, s)


import math
(n, m, k) = map(int, input().split())
s = n * 2 * m
l = math.ceil(k / (2 * m))
c = k - (l - 1) * 2 * m
r = math.ceil(c / 2)
if k % 2 == 0:
	print(l, r, 'R')
else:
	print(l, r, 'L')


(x, y, t) = map(int, input().split())
for i in range(1, x + 1):
	p = i * (y * 2)
	if t <= p:
		print(i, end=' ')
		break
p -= 1
for i in range(y, 0, -1):
	if t >= p:
		print(i, end=' ')
		break
	p -= 2
print('R' if t % 2 == 0 else 'L')


(n, m, k) = map(int, input().split())
A = ['L', 'R']
res1 = (k + 2 * m - 1) // (2 * m)
res2 = (k - 2 * m * (res1 - 1) + 1) // 2
res3 = (k - 2 * m * res1 + 1 - res2 * 2) % 2
print(res1, res2, A[res3])


import math
(n, m, k) = list(map(int, input().split()))
if k % 2 == 1:
	pos = 'L'
else:
	pos = 'R'
r = math.ceil(k / (2 * m))
k -= (r - 1) * 2 * m
f = math.ceil(k / 2)
print(r, f, pos)


import math
(n, m, k) = map(int, input().split())
lane = math.ceil(k / (2 * m))
if k % 2 == 0:
	seat = 'R'
else:
	seat = 'L'
while k > 2 * m:
	k = k - 2 * m
desk = math.ceil(k / 2)
print(lane, desk, seat)


a = input().split()
if int(a[2]) % 2 == 0:
	s = 'R'
else:
	s = 'L'
k = 0
if int(a[2]) % (int(a[1]) * 2) > 0:
	k += 1
r = int(a[2]) % (int(a[1]) * 2) // 2 + int(a[2]) % (int(a[1]) * 2) % 2
if r == 0:
	r = a[1]
print(int(a[2]) // (int(a[1]) * 2) + k)
print(r)
print(s)


import math
ent = input()
(n, m, k) = ent.split()
saida = list()
saida.append(math.ceil(float(k) / (2 * float(m))))
if math.ceil(int(k) % (2 * int(m)) / 2) != 0:
	saida.append(math.ceil(int(k) % (2 * int(m)) / 2))
else:
	saida.append(int(m))
if int(k) % 2 == 0:
	saida.append('R')
else:
	saida.append('L')
print('{} {} {}'.format(saida[0], saida[1], saida[2]))


def rorl(x):
	if x % 2 == 0:
		return 'R'
	else:
		return 'L'
import math
(row, column, target) = map(int, input().split(' '))
print(str(math.ceil(target / (2 * column))) + ' ' + str((target - 1) % (column * 2) // 2 + 1) + ' ' + rorl(target))


import sys
import math
import bisect
import itertools
import random

def main():
	(n, m, k) = map(int, input().split())
	no_lane = math.ceil(k / (2 * m))
	tmp = k % (2 * m)
	if tmp == 0:
		tmp = 2 * m
	no_desk = math.ceil(tmp / 2)
	if k % 2 == 1:
		pos = 'L'
	else:
		pos = 'R'
	print('%d %d %s' % (no_lane, no_desk, pos))
main()


n = list(map(int, input().split()))
c = 0
lst = []
for j in range(1, n[0] * 2 + 1):
	if j % 2 == 0:
		v = n[1] * j
		if v >= n[2]:
			c = n[1] - (v - n[2]) // 2
			lst.append(j // 2)
			break
if n[2] % 2 == 0:
	b = 'R'
else:
	b = 'L'
print(lst[0], c, b)


a = input().split()
n = int(a[0])
m = int(a[1])
k = int(a[2])
import math
if k % 2 == 0:
	pos = 'R'
else:
	pos = 'L'
a1 = math.ceil(k / (2 * m))
a2 = (k - (a1 - 1) * m * 2 + 1) // 2
print(a1, a2, pos)


from math import *
(n, m, l) = list(map(int, input().split()))
k = l // (m * 2)
r = l % (2 * m)
t = l % 2
if t == 1:
	t = 'L'
else:
	t = 'R'
if r != 0:
	print(k + 1, r // 2 + r % 2, t)
else:
	print(k, m, 'R')


import math
(n_row, n_desk, n_sant) = list(map(lambda x: int(x), str(input()).split(' ')))
desk = math.ceil(n_sant / (n_desk * 2))
seat = ''
if n_sant % 2 == 0:
	seat = 'R'
else:
	seat = 'L'
row = math.ceil((n_sant - n_desk * 2 * (desk - 1)) / 2)
if n_sant == 1 or n_sant == 2:
	row = 1
print(desk, row, seat)


from math import ceil as c
(n, m, k) = map(int, input().split())
print(c(k / (2 * m)), end=' ')
if k % (2 * m) == 0:
	print(m, end=' ')
else:
	print(c(k % (2 * m) / 2), end=' ')
if k % 2 == 0:
	print('R')
else:
	print('L')


(n, m, s) = map(int, input().split())
if s % 2 == 1:
	ch = 'L'
else:
	ch = 'R'
p = s
d = 1
while p > m * 2:
	p = p - m * 2
	d = d + 1
a = p // 2 + p % 2
print(d, a, ch)


(a, b, c) = map(int, input().split())
for x in range(1, a + 1):
	sum = b * x * 2
	if c <= sum:
		print(x, end=' ')
		break
for i in range(1, b + 1):
	m = b * 2 * (x - 1) + 2 * i
	if c <= m:
		print(i, end=' ')
		break
if c % 2 == 0:
	print('R', end='')
else:
	print('L', end='')


s = input()
nums = s.split(' ')
r = int(nums[0])
p = int(nums[1])
mesto = int(nums[2])
pm = (mesto + 1) // 2
rs = (pm - 1) // p + 1
ps = pm % p
if ps == 0:
	ps = p
if mesto % 2 == 0:
	side = 'R'
else:
	side = 'L'
print(rs, ps, side)


from math import *
(m, n, o) = map(int, input().split())
lane = ceil(o / (2 * n))
first = (lane - 1) * n * 2 + 1
row = 1 + (o - first) // 2
print(lane, row, 'L' if o % 2 == 1 else 'R')


(n, m, k) = map(int, input().split())
lr = 'L'
if k % 2 == 0:
	lr = 'R'
k = (k + 1) // 2
lane = (k + m - 1) // m
desk = k % m
if desk == 0:
	desk = m
print('{} {} {}'.format(lane, desk, lr))


(_, n, m) = map(int, input().split())
(n, m) = (n << 1, m - 1)
print(m // n + 1, m % n + 2 >> 1, 'LR'[m & 1])


import math
info = [int(x) for x in input().split()]
lanes = info[0]
desks = info[1]
location = info[2]
seats_in_lane = 2 * desks
lane = math.ceil(location / seats_in_lane)
starting_group = (lane - 1) * seats_in_lane + 1
desk = math.ceil((location - starting_group + 1) / 2)
l_r = 'R' if location % 2 == 0 else 'L'
print(lane, desk, l_r)


(x, y, z) = map(int, input().split())
s = (z + (2 * y - 1)) // (2 * y)
d = ((z + 1) // 2 + y - 1) % y + 1
print(s, d, ['R', 'L'][z % 2])


(n, m, k) = map(int, input().split())
pl = ''
if k % 2 == 0:
	pl = 'R'
else:
	pl = 'L'
k = k // 2 + k % 2
part = k % m
rad = k // m + 1
if k % m == 0:
	rad -= 1
if part == 0:
	part = m
print(rad, part, pl)


(n, m, k) = list(map(int, input().split(' ')))
l = True
if k % 2 == 0:
	l = False
	d = k / 2
else:
	d = (k + 1) / 2
col = int((d - 1) % m + 1)
row = int((d - 1) // m + 1)
if l:
	print(str(row), str(col), 'L')
else:
	print(str(row), str(col), 'R')


def solve():
	(n, m, k) = map(int, input().split())
	r = (k - 1) // (2 * m)
	p = (k - 1) % (2 * m) + 1
	x = 'L' if p % 2 else 'R'
	return (r + 1, (p + 1) // 2, x)
print(' '.join(map(str, solve())))


(m, n, k) = map(int, input().split())
col = int((k - 1) / (2 * n)) + 1
row = int((k - (col - 1) * 2 * n - 1) / 2) + 1
if k % 2 == 0:
	dir = 'R'
else:
	dir = 'L'
print(col, row, dir)


l = input().split()
(n, m, k) = (int(l[0]), 2 * int(l[1]), int(l[2]))

def round(x):
	if x - int(x) == 0:
		return int(x)
	else:
		return int(x) + 1

def side(x):
	if x % 2 == 0:
		return 'R'
	else:
		return 'L'
lane = round(k / m)
side = side(k)
disk = round(k % m / 2)
if disk == 0:
	disk += m // 2
print(lane, disk, side)


(n, m, k) = map(int, input().split())
ans = []
number = 2 * n * m
col = number // n
c = k // col
if k % col != 0:
	c = c + 1
ans.append(c)
row = col // m
col_start = col * (c - 1)
col_end = col * c
r = 0
ans_row = 1
for i in range(col_start + 1, col_end + 1):
	if i == k:
		ans.append(ans_row)
	r = r + 1
	if r == row:
		ans_row = ans_row + 1
		r = 0
if k % 2 == 0:
	ans.append('R')
else:
	ans.append('L')
print(*ans)


import math
(n, m, k) = map(int, input().split())
a = math.ceil(k / (m * 2))
b = math.ceil(k % (m * 2) / 2)
if b == 0:
	b = m
if k % (m * 2) % 2 == 0:
	c = 'R'
else:
	c = 'L'
print(a, b, c)


(n, m, k) = map(int, input().split())
p = m * 2
i = 0
r = 1
while i + p < k:
	i = i + p
	r = r + 1
k = k - p * (r - 1)
if k % 2 == 0:
	i = 2
	v = 1
	while i != k:
		v = v + 1
		i = i + 2
	print(r, v, 'R')
else:
	i = 1
	v = 1
	while i != k:
		v = v + 1
		i = i + 2
	print(r, v, 'L')


(n, m, k) = map(int, input().split())
per1 = (k - 1) // (2 * m)
print(1 + per1, end=' ')
per2 = k - per1 * (2 * m)
print(1 + (per2 - 1) // 2, end=' ')
if k % 2 == 0:
	print('R')
else:
	print('L')


(n, m, s) = map(int, input().split())
part = (s + 1) // 2
r = part / m if part % m == 0 else part // m + 1
p = m if part % m == 0 else part % m
b = 'R' if s % 2 == 0 else 'L'
print(int(r), int(p), b)


(_, m, k) = map(int, input().split())
x = (k + 1) // 2
print(-(-x // m), (x - 1) % m + 1, 'RL'[k % 2])


from math import ceil
(n, m, k) = list(map(int, input().split()))
q = ceil(k / 2)
if k % (2 * m) == 0:
	w = k // (2 * m)
else:
	w = k // (2 * m) + 1
chet = 1
chislo = (w - 1) * (m * 2) + 1
while chislo != k:
	if chislo % 2 == 0:
		chet += 1
	chislo += 1
if k % 2 == 0:
	print(str(w) + ' ' + str(chet) + ' R')
else:
	print(str(w) + ' ' + str(chet) + ' L')


(r, p, n) = map(int, input().split())
print((n - 1) // (p * 2) + 1, (n - 1) % (p * 2) // 2 + 1, sep=' ', end=' ')
if n % 2 == 0:
	print('R')
else:
	print('L')


import math
from fractions import Fraction as frac
MOD = 1000000000.0 + 7

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def solve(case_no):
	(n, m, k) = map(int, input().split())
	x = 1
	y = 1
	while k > 2 * m:
		k -= 2 * m
		x += 1
	y = (k + 1) // 2
	print(x, y, 'R' if (k + 1) % 2 == 1 else 'L')
t = 1
for i in range(1, t + 1):
	solve(i)


(n, m, k) = map(int, input().split())
row = ((k + 1) // 2 - 1) // m + 1
s = ['R', 'L']
desk = (k + 1) // 2 - m * (row - 1)
print(row, desk, s[k % 2])


(n, m, k) = list(map(int, input().split()))
ryad = (k - 1) // (m * 2) + 1
table = (k + 1 - (ryad - 1) * m * 2) // 2
if k % 2 == 0:
	direct = 'R'
else:
	direct = 'L'
print(ryad, table, direct)


(n, m, k) = [int(i) for i in input().split()]
if k % 2 == 0:
	z = 'R'
else:
	z = 'L'
m1 = (k - 1) // (2 * m) + 1
n1 = (k - 1) % (2 * m) // 2 + 1
print(m1, n1, z)


(n, m, k) = map(lambda x: int(x), input().split())
m1 = m * 2
if k % m1 != 0:
	rowMain = k // m1 + 1
else:
	rowMain = k // m1
k1 = k - (rowMain - 1) * m1
if k1 % 2 == 0:
	tableMain = k1 // 2
else:
	tableMain = k1 // 2 + 1
place = 'L' if k % 2 == 1 else 'R'
print(rowMain, tableMain, place)


(N, M, K) = map(int, input().split())
row_size = 2 * M
K -= 1
row = K // row_size
K %= row_size
side = 'L' if K % 2 == 0 else 'R'
d = K // 2
print(row + 1, d + 1, side)


(n, m, k) = [int(i) for i in input().split()]
ryad = k // (2 * m) + 1
if k % (2 * m) == 0:
	ryad -= 1
parta = (k - 2 * m * (ryad - 1)) // 2 + k % 2
if k % 2 == 0:
	mesto = 'R'
else:
	mesto = 'L'
print(ryad, parta, mesto)


(n, m, k) = list(map(int, input().split()))
k2 = (k - 1) // 2 + 1
ans2 = k2 % m
if ans2 == 0:
	ans2 = m
print((k2 - 1) // m + 1, ans2, end=' ')
if k % 2 == 1:
	print('L')
else:
	print('R')


from operator import itemgetter
(n, m, k) = map(int, input().split())
r = (k - 1) // (m * 2)
d = (k + 1 - r * 2 * m) // 2
ans = (k + 1 - r * 2 * m) % 2
print(r + 1, d, 'R' * ans + 'L' * (1 - ans))


(n, m, k) = map(int, input().split())
(l, d) = (0, 0)
g = 2 * m
if k % g == 0:
	l = k // g
else:
	l = k // g + 1
c = k % g
if c == 0:
	d = m
elif c % 2 == 0:
	d = c // 2
else:
	d = c // 2 + 1
if k % 2 == 0:
	print(l, d, 'R')
else:
	print(l, d, 'L')


from math import ceil
(n, m, k) = map(int, input().split())
row = ceil(k / (2 * m))
print(row, ceil((k - 2 * m * (row - 1)) / 2), 'R' if k % 2 == 0 else 'L')


(n, m, k) = map(int, input().split())
block = m * 2
if k % block == 0:
	ryad = k // block
else:
	ryad = k // block + 1
per = k
while per > block:
	per -= block
if per % 2 == 0:
	s = 'R'
	parta = per // 2
else:
	s = 'L'
	parta = per // 2 + 1
print(ryad, parta, s)


(n, m, k) = map(int, input().strip().split())
n = 0
i = 1
j = m * 2
o = 1
answn = 0
answm = 0
while answn == 0:
	if k <= j and k >= i:
		answn = o
	else:
		i += m * 2
		j += m * 2
		o += 1
i = 1 + (o - 1) * 2 * m
j = 2 + (o - 1) * 2 * m
o = 1
while answm == 0:
	if k <= j and k >= i:
		answm = o
	else:
		i += 2
		j += 2
		o += 1
if k % 2 == 0:
	print(answn, answm, 'R')
else:
	print(answn, answm, 'L')


(n, m, k) = map(int, input().split())
row = (k - 1) // (2 * m) + 1
pl = (k - 1) % (2 * m) // 2 + 1
print(f"{row} {pl} {('L' if k % 2 else 'R')}")


(n, m, k) = map(int, input().split())
z = (k + 2 * m - 1) // (2 * m)
q = k % (2 * m)
if q == 0:
	q = 2 * m
q = (q + 1) // 2
w = q % 2
if k % 2:
	w = 'L'
else:
	w = 'R'
print(z, q, w)


n = input()
n = n.split(' ')
x = int(n[0])
y = int(n[1])
z = int(n[2])
l = 0
if z % (2 * y) == 0:
	r = z // (2 * y)
else:
	r = z // (2 * y) + 1
if r == 1:
	if z % 2 == 0:
		p = z // 2
	else:
		p = z // 2 + 1
else:
	l = z - (r - 1) * y * 2
	if l % 2 == 0:
		p = l // 2
	else:
		p = l // 2 + 1
if z % 2 == 0:
	a = 'R'
else:
	a = 'L'
print(r, p, a)


(n, m, k) = map(int, input().split())
t1 = 2 * m
ps1 = (k - 1) // t1 + 1
ps2 = k % t1
if ps2 == 0:
	ps2 = 2 * m
print(ps1, (ps2 + ps2 % 2) // 2, 'L' if ps2 % 2 == 1 else 'R')


spot = list(map(int, input().split()))
row = spot[2] // (spot[1] * 2)
ost = spot[2] % (spot[1] * 2)
if ost > 0:
	parta = ost // 2
	if ost / 2 != parta:
		parta += 1
	if ost % 2 == 0:
		print(row + 1, parta, 'R')
	else:
		print(row + 1, parta, 'L')
else:
	print(row, spot[1], 'R')


(n, m, k) = [int(i) for i in input().split()]
a = (k - 1) // (2 * m) + 1
b = (k - 1) % (2 * m) // 2 + 1
if (k - 1) % (2 * m) % 2 == 1:
	print(str(a) + ' ' + str(b) + ' ' + 'R')
else:
	print(str(a) + ' ' + str(b) + ' ' + 'L')


(n, m, k) = map(int, input().split())
t = (k - 1) // 2 // m + 1
s = (k - 1) // 2 % m + 1
if k % 2 != 0:
	print(t, s, 'L')
else:
	print(t, s, 'R')


(n, m, k) = [int(s) for s in input().split(' ')]
lr = ['R', 'L']
answer = [(k - 1) // (m * 2) + 1, (k - 1) % (2 * m) // 2 + 1, lr[k % 2]]
print(*answer)


def main():
	from math import ceil
	[n, m, k] = [int(_) for _ in input().split()]
	mod = k % (m * 2)
	if mod == 0:
		mod = m * 2
	desk = ceil(mod / 2)
	lane = ceil(k / (m * 2))
	pos = 'L' if k % 2 != 0 else 'R'
	print(lane, desk, pos)
main()


k = input().split()
r = int(k[0])
p = int(k[1])
m = int(k[2])
print(((m + 1) // 2 + (p - 1)) // p, end=' ')
print((m + 1) // 2 - (((m + 1) // 2 + (p - 1)) // p - 1) * p, end=' ')
if m % 2 == 0:
	print('R')
else:
	print('L')


(lanes, desk, position) = [int(x) for x in input().split()]
OneOrTwo = ['R', 'L'][position % 2]
row = (position - 1) // (desk * 2) + 1
col = (position - 1) % (desk * 2) // 2 + 1
print(row, col, OneOrTwo)


(n, m, k) = map(int, input().split())
all_desks = n * m
desks_in_row = m
rows = n
if k % 2 == 0:
	left_sit = False
	for_print = 'R'
else:
	left_sit = True
	for_print = 'L'
desk = k // 2
if left_sit:
	desk += 1
d = desk % desks_in_row
if desk % desks_in_row == 0:
	d = desks_in_row
r = desk // desks_in_row
if desk % desks_in_row != 0:
	r += 1
print(r, d, for_print)


(n, m, k) = [int(i) for i in input().split(' ')]
print((k - 1) // 2 // m + 1, (k - 1) // 2 % m + 1, (k - 1) % 2 * 'R' + k % 2 * 'L')


(a, b, c) = map(int, input().split())
z = c // (b * 2)
x = c % (b * 2)
if x == 0:
	print(z, b, 'R')
elif x % 2 == 0:
	print(z + 1, x // 2, 'R')
else:
	print(z + 1, x // 2 + 1, 'L')


from math import ceil
(rows, columns, place) = map(int, input().split())
print(ceil(place / (columns * 2)), ceil((place % (columns * 2) if place % (columns * 2) != 0 else 2 * columns) / 2), 'L' if place % 2 else 'R')


def r():
	return list(map(int, input().split()))
(n, m, k) = r()
a = (k + 2 * m - 1) // (2 * m)
k -= (a - 1) * 2 * m
b = (k + 1) // 2
c = 'R' if k % 2 == 0 else 'L'
print(a, b, c)


s = input().split()
n = int(s[0])
m = int(s[1])
k = int(s[2])
r = 0
a = 0
while k > 2 * m:
	k = k - 2 * m
	r += 1
if k % 2 == 0:
	a = k // 2
else:
	a = k // 2 + 1
if k % 2 == 0:
	print(r + 1, ' ', a, ' R')
else:
	print(r + 1, ' ', a, ' L')


f = lambda : map(int, input().split())
(n, m, k) = f()
if k % 2 != 0:
	x = ((k + 1) // 2 - 1) % m + 1
	print(((k + 1) // 2 - 1) // m + 1, x, 'L')
else:
	x = (k // 2 - 1) % m + 1
	print((k // 2 - 1) // m + 1, x, 'R')


import math
string = input()
(a, b, n) = map(int, string.split())
r = math.ceil(n / (b * 2))
s = n - b * 2 * (r - 1)
c = math.ceil(s / 2)
if s % 2 == 0:
	p = 'R'
else:
	p = 'L'
print('%d %d %s' % (r, c, p))


import math
s = input()
n = int(s.split()[0])
m = int(s.split()[1])
k = int(s.split()[2])
i = math.ceil(k / (2 * m))
k -= (i - 1) * 2 * m
j = math.ceil(k / 2)
if k % 2 == 1:
	print('%d %d L' % (i, j))
else:
	print('%d %d R' % (i, j))


alph = 'abcdefghijklmnopqrstuvwxyz'
(n, m, k) = map(int, input().split())
print((k - 1) // (2 * m) + 1, (k - 1) % (2 * m) // 2 + 1, end=' ')
if k % 2 == 0:
	print('R')
else:
	print('L')


a = str()
j = int()
k = int()
n = int()
RL = str()
c = []
a = input().split(' ')
for j in range(3):
	c.append(a[j])
k = (int(a[2]) % 2 + int(a[2])) // 2
j = (k - 1) // int(a[1]) + 1
n = k - (j - 1) * int(a[1])
if int(a[2]) % 2 == 1:
	RL = 'L'
else:
	RL = 'R'
print(j, n, RL, end='')


def main():
	(n, m, k) = [int(i) for i in input().split()]
	s = 'L' if k % 2 == 1 else 'R'
	k = (k - 1) // 2
	d = k % m
	print(k // m + 1, d + 1, s)
main()


import math, sys
fin = sys.stdin
fout = sys.stdout
(n, m, x) = map(int, fin.readline().split())
r = math.ceil(x / (m * 2))
d = math.ceil((x - (r - 1) * (m * 2)) / 2)
s = ''
if x % 2 == 1:
	s = 'L'
else:
	s = 'R'
fout.write(str(r) + ' ' + str(d) + ' ' + str(s))


(n, m, k) = map(int, input().split())
m = 2 * m
ans = 'R'
if k & 1:
	ans = 'L'
	k += 1
ans1 = k / m
if ans1 != int(ans1):
	ans1 = int(ans1) + 1
ans2 = (k - m * (int(ans1) - 1)) // 2
print(int(ans1), ans2, ans)


(n, m, k) = map(int, input().split())
row = 1
pos = ''
line = 0
line = k
while line > m * 2:
	line -= m * 2
	row += 1
if line % 2 == 0:
	pos = 'R'
else:
	pos = 'L'
if line % 2 == 0:
	line = line // 2
else:
	line = line // 2 + 1
print(row, ' ', line, ' ', pos)


(n, m, k) = map(int, input().split())
k -= 1
Lane = 2 * m
Desk = k % Lane // 2
Lane = k // Lane
L = Desk % 2
if k % 2 == 1:
	print(str(Lane + 1) + ' ' + str(Desk + 1) + ' ' + 'R')
else:
	print(str(Lane + 1) + ' ' + str(Desk + 1) + ' ' + 'L')


import math
(n, m, k) = map(int, input().split())
lane = math.ceil(k / (m * 2))
red = k % (2 * m)
if red == 0:
	print(lane, m, 'R')
elif k % 2 == 0:
	print(lane, (red + 1) // 2, 'R')
else:
	print(lane, (red + 1) // 2, 'L')


(n, m, k) = map(int, input().split())
row = (k - 1) // (2 * m) + 1
place = k % (2 * m)
if place == 0:
	place = 2 * m
s = None
p = (place - 1) // 2 + 1
if place % 2 == 0:
	s = 'R'
else:
	s = 'L'
print(row, p, s)


import math
detail = [int(n) for n in input().split()]
found = False
lane_size = 2 * detail[1]
location = list()
location.append(str(int(math.ceil(float(detail[2] / lane_size)))))
location.append(str(int(math.ceil(float(detail[2] - (int(location[0]) - 1) * lane_size) / 2))))
if int(detail[2]) % 2 == 1:
	location.append('L')
else:
	location.append('R')
print(' '.join((x for x in location)))


(n, m, k) = map(int, input().split())

def getRyad(n, m, k):
	r = 1
	mest_v_radu = m * 2
	while n != 0:
		if mest_v_radu < k:
			r += 1
			mest_v_radu = mest_v_radu + m * 2
			n -= 1
		else:
			return r

def getParta(r, m, k):
	parta = r * m * 2
	while m != 0:
		if parta == k or parta - 1 == k:
			return m
		else:
			m -= 1
			parta -= 2

def getStorona(k):
	if k % 2 == 0:
		return 'R'
	else:
		return 'L'
r = getRyad(n, m, k)
d = getParta(r, m, k)
s = getStorona(k)
print(r, d, s)


from math import *
(n, m, k) = map(int, input().split())
ans1 = 1
ans2 = 1
ans3 = 'L'
if k % 2 == 0:
	ans3 = 'R'
x = 1
while x != k:
	if x % 2 == 0:
		ans2 += 1
	if ans2 == m + 1:
		ans1 += 1
		ans2 = 1
	x += 1
print(ans1, ans2, ans3)


def main_function():
	(n, m, k) = [int(i) for i in input().split(' ')]
	lane = 0
	while k > 2 * m * lane:
		lane += 1
	if not k % 2:
		b = k - 1
	else:
		b = k
	desk = (b % (2 * m) + 1) // 2
	if not k % 2:
		s = 'R'
	else:
		s = 'L'
	return f'{lane} {desk} {s}'
print(main_function())


(n, m, k) = map(int, input().split())
if k % 2 == 0:
	mesto = 'R'
else:
	mesto = 'L'
if k % (2 * m) == 0:
	rud = k // (2 * m)
else:
	rud = k // (2 * m) + 1
if k % (2 * m) == 0 or k % (2 * m) == 2 * m - 1:
	parta = m
else:
	k = k % (2 * m)
	if k % 2 == 0:
		parta = k // 2
	else:
		parta = k // 2 + 1
print(rud, parta, mesto)


from math import ceil
(n, m, k) = map(int, input().split())
if k % 2:
	pos = 'L'
	d = k // 2 + 1
else:
	pos = 'R'
	d = k // 2
p = m * 2
col = d % m
if col == 0:
	col = m
row = ceil(k / p)
if row == 0:
	row = n
print(row, col, pos)


a = input().split()
(m, k) = (2 * int(a[1]), int(a[2]) - 1)
print(k // m + 1, k % m // 2 + 1, 'LR'[k % 2])


(n, m, k) = map(int, input().split())
loop = 0
for i in range(1, n + 1):
	c = m * i * 2
	if k < c and c - k > 1:
		for j in range(m, 1, -1):
			c -= 2
			if c == k or c - k == 1:
				loop = 1
				break
	elif k == c or c - k == 1:
		j = m + 1
		loop = 1
	if loop:
		break
if k % 2 == 0:
	print(i, j - 1, 'R')
else:
	print(i, j - 1, 'L')


from math import ceil
(n, m, k) = (int(i) for i in input().split())
ryad = ceil(k / (2 * m))
parta = (k % (2 * m) + 1) // 2
if k % 2:
	left = 'L'
else:
	left = 'R'
if parta == 0:
	parta = m
print(ryad, parta, left)


(n, m, k) = map(int, input().split())
if k % 2 != 0:
	c = 'L'
else:
	c = 'R'
s = 0
h = m * 2
o = 1
i = 1
l = 2
while 1:
	s = s + h
	if k <= s:
		break
	i = i + 1
flag = 0
q = 0
while 1:
	if o <= k < o + h:
		for y in range(1, m + 1):
			q = o + 2 * y
			if q > k:
				flag = 1
				break
		if flag == 1:
			break
	else:
		o = o + h
print(i, y, c)


(n, m, k) = map(int, input().split())
num = 1
lastnum = 1
i_n = 0
for i in range(2, n + 2):
	i_n += 1
	lastnum = num
	num += 2 * m
	if num > k:
		num = lastnum
		rd = i_n
		prt = 1
		if k % 2 == 1:
			while num != k:
				num += 2
				prt += 1
			print(rd, prt, 'L')
		else:
			num += 1
			while num != k:
				num += 2
				prt += 1
			print(rd, prt, 'R')
		break


import math
(lanes, desks, number) = map(int, input().split())
numberperlane = desks * 2
column = math.ceil(number / numberperlane)
row = math.ceil((number - (column - 1) * numberperlane) / 2)
print(column, row, 'R' if number % 2 == 0 else 'L')


(rows, cols, place) = map(int, input().split())
place -= 1
parta = place // 2
(row, col) = (parta // cols, parta % cols)
print(row + 1, col + 1, 'LR'[place % 2])


(n, m, k) = list(map(int, input().split()))
print((k + (m << 1) - 1) // (m << 1), (k - 1) // 2 % m + 1, ['R', 'L'][k % 2])


(n, m, k) = map(int, input().split())
k -= 1
z = k // 2
x = z // m
y = z % m
print(x + 1, y + 1, ('L', 'R')[k % 2])


(N, M, K) = map(int, input().split())
lane = K // (2 * M) + bool(K % (2 * M))
if K % 2 == 0:
	char = 'R'
else:
	char = 'L'
desk = (K - 2 * M * (lane - 1)) // 2 + bool((K - 2 * M * (lane - 1)) % 2)
print(lane, desk, char)


inp = str(input())
s = ''
for s in inp:
	s = inp.split(' ')
n = int(s[0])
m = int(s[1])
k = int(s[2])
i = 0
r = 1
d = 1
p = 0
while k > 2 * m * r:
	p = 2 * m * r
	r += 1
while k > p:
	p += 1
	if i == 2:
		i = 0
		d += 1
	i += 1
if k % 2 == 0:
	print(r, d, 'R')
else:
	print(r, d, 'L')


(n, m, k) = map(int, input().split())
k -= 1
p = k // 2
p = p // m
print('%d %d %s' % (p + 1, k // 2 - p * m + 1, 'R' if k % 2 == 1 else 'L'))


import math
_input = input().split()
lanes = int(_input[0])
desks = int(_input[1])
k = int(_input[2])
dd = desks * 2
col = math.ceil(k / dd)
z = k - (col - 1) * dd
row = math.ceil(z / 2)
if k & 1:
	print(str(col) + ' ' + str(row) + ' L')
else:
	print(str(col) + ' ' + str(row) + ' R')


(n, m, k) = input().split()
n = int(n)
m = int(m)
k = int(k)
quot = int(k / (2 * m))
rem = k % (2 * m)
if rem != 0:
	quot += 1
if rem == 0:
	d = m
	r = 0
else:
	d = int(rem / 2)
	r = int(rem % 2)
	if r != 0:
		d += 1
if r == 1:
	print(str(quot) + ' ' + str(d) + ' ' + 'L')
if r == 0:
	print(str(quot) + ' ' + str(d) + ' ' + 'R')


(n, m, k) = map(int, input().split())
if k % 2 == 0:
	z = k // 2
	d = 'R'
else:
	z = (k + 1) // 2
	d = 'L'
x = 1
i = 0
while 1:
	if x > z:
		break
	else:
		x = x + m
	i += 1
if z % m != 0:
	z = z % m
else:
	z = m
print(i, z, d)


from math import ceil
(n, m, k) = map(int, input().split())
r = ceil(k / (m * 2))
d = m - (r * m * 2 - k) // 2
print(r, d, ['R', 'L'][k % 2])


from math import ceil
(n, m, k) = map(int, input().split())
x = ceil(k / (2 * m))
if k % (2 * m):
	y = ceil(k % (2 * m) / 2)
else:
	y = m
z = 'L' if k % 2 else 'R'
print(x, y, z)


(n, m, k) = [int(f) for f in input().split(' ') if f]
r = k / (2 * m)
if r % 1:
	r = int(r // 1 + 1)
d = (k - 2 * (r - 1) * m) / 2
if d % 1:
	d = int(d // 1 + 1)
print(int(r), int(d), sep=' ', end=' ')
if not k % 2:
	print('R')
else:
	print('L')


from math import ceil as c
(l, d, p) = map(int, input().split())
x = c(p / (2 * d))
y = p - 2 * d * (x - 1)
print(x, c(y / 2), end=' ')
if y % 2 == 1:
	print('L')
else:
	print('R')


import math
(n, m, k) = map(int, input().split())
(r, d, s) = (0, 0, '')
if k % 2:
	s = 'L'
else:
	s = 'R'
r = k / (m * 2)
r = math.ceil(r)
r_start = 2 * m * (r - 1) + 1
r_end = r_start + 2 * m - 1
i = r_start
while i <= k:
	d += 1
	i += 1
print(r, math.ceil(d / 2), s)


(c, b, n) = map(int, input().split())
if n % 2 == 0:
	p = int(n / 2)
	s = p % b
	if s == 0:
		s = s + b
	if n % (2 * b) == 0:
		x = int(n / (2 * b))
	else:
		x = int(n / (2 * b)) + 1
	print(x, s, 'R')
else:
	p = int(n / 2) + 1
	s = p % b
	if s == 0:
		s = s + b
	if n % (2 * b) == 0:
		x = int(n / (2 * b))
	elif n % (2 * b) > 0:
		x = int(n / (2 * b)) + 1
	print(x, s, 'L')


from math import ceil
(m, n, k) = map(int, input().split())
ryad = ceil(k / (n * 2))
k %= n * 2
mesto = ceil(k / 2)
storona = ['R', 'L'][k % 2]
if ryad == 0:
	ryad += m
if mesto == 0:
	mesto += n
print(ryad, mesto, storona)


(n, m, k) = map(int, input().split())
if k % (2 * m) == 0:
	p = k // (2 * m)
else:
	p = k // (2 * m) + 1
if (k - 2 * m * (p - 1)) % 2 == 0:
	mes = (k - 2 * m * (p - 1)) // 2
else:
	mes = (k - 2 * m * (p - 1)) // 2 + 1
if k % 2 == 0:
	pos = 'R'
else:
	pos = 'L'
print(p, mes, pos)