문제링크:https://www.acmicpc.net/problem/10250
import sys
t = int(sys.stdin.readline())
for q in range(t):
h, w, p = map(int, sys.stdin.readline().split())
j = 0
k = 1
for i in range(1, p+1):
j += 1
if i == p:
if h == 1:
if len(str(p)) == 1:
print(str(h)+'0'+str(p))
else:
print(str(h)+str(p))
elif len(str(k)) == 1:
print(str(j)+'0'+str(k))
else:
print(str(j) + str(k))
if j == h:
j = 0
k += 1