Valera has got a rectangle table consisting of n rows and m columns. Valera numbered the table rows starting from one, from top to bottom and the columns – starting from one, from left to right. We will represent cell that is on the intersection of row x and column y by a pair of integers (x, y).

Valera wants to place exactly k tubes on his rectangle table. A tube is such sequence of table cells (x_1, y_1), (x_2, y_2), ..., (x_{r}, y_{r}), that:   r ≥ 2;  for any integer i (1 ≤ i ≤ r - 1) the following equation |x_{i} - x_{i} + 1| + |y_{i} - y_{i} + 1| = 1 holds;  each table cell, which belongs to the tube, must occur exactly once in the sequence. 

Valera thinks that the tubes are arranged in a fancy manner if the following conditions are fulfilled:   no pair of tubes has common cells;  each cell of the table belongs to some tube. 

Help Valera to arrange k tubes on his rectangle table in a fancy manner.


-----Input-----

The first line contains three space-separated integers n, m, k (2 ≤ n, m ≤ 300; 2 ≤ 2k ≤ n·m) — the number of rows, the number of columns and the number of tubes, correspondingly. 


-----Output-----

Print k lines. In the i-th line print the description of the i-th tube: first print integer r_{i} (the number of tube cells), then print 2r_{i} integers x_{i}1, y_{i}1, x_{i}2, y_{i}2, ..., x_{ir}_{i}, y_{ir}_{i} (the sequence of table cells).

If there are multiple solutions, you can print any of them. It is guaranteed that at least one solution exists. 


-----Examples-----
Input
3 3 3

Output
3 1 1 1 2 1 3
3 2 1 2 2 2 3
3 3 1 3 2 3 3

Input
2 3 1

Output
6 1 1 1 2 1 3 2 3 2 2 2 1



-----Note-----

Picture for the first sample:  [Image] 

Picture for the second sample:  [Image]

Difficulty: interview

Starter code:

Solutions:
"""
Codeforces Round 252 Div 2 Problem C

Author  : chaotic_iak
Language: Python 3.3.4
"""

def read(mode=2):
    # 0: String
    # 1: List of strings
    # 2: List of integers
    inputs = input().strip()
    if mode == 0:
        return inputs
    if mode == 1:
        return inputs.split()
    if mode == 2:
        return [int(x) for x in inputs.split()]

def write(s="\n"):
    if isinstance(s, list): s = " ".join(s)
    s = str(s)
    print(s, end="")

################################################### SOLUTION
n,m,k = read()

cells = []
for i in range(n):
    if not i%2:
        for j in range(m): cells.append((i+1,j+1))
    else:
        for j in range(m-1, -1, -1): cells.append((i+1,j+1))

ct = 0
for i in range(k-1):
    print(2, cells[ct][0], cells[ct][1], cells[ct+1][0], cells[ct+1][1])
    ct += 2

print(len(cells) - ct, end=" ")
for i in cells[ct:]:
    print(i[0], i[1], end=" ")

n, m, k = [int(i) for i in input().split()]
cur = 0
colored = 0
a = [[0] * m for i in range(n)]
res = [[] for i in range(k)]
for i in range(0, n - 1, 2):
    for j in range(m):
        if colored == 2:
            cur = min(cur + 1, k - 1)
            colored = 0
        res[cur].append(i)
        res[cur].append(j)
        colored += 1
    for j in range(m - 1, -1, -1):
        if colored == 2:
            colored = 0
            cur = min(cur + 1, k - 1)
        res[cur].append(i + 1)
        res[cur].append(j)
        colored += 1
if n % 2 == 1:
    for j in range(m):
        if colored == 2:
            colored = 0
            cur = min(cur + 1, k - 1)
        res[cur].append(n - 1)
        res[cur].append(j)
        colored += 1

for i in res:
    print(len(i) // 2, end=" ")
    print(" ".join([str(j + 1) for j in i]))

n,m,k = [int(i) for i in input().split()]
import sys
seq = []
rev = False
for i in range(n):
    l = list(zip([i+1]*m,range(1,m+1)))
    if rev:
        l.reverse()
    seq += l
    rev = not rev

for i in range(k-1):
    sys.stdout.write('2 ' + str(seq[i*2][0]) + ' ' + str(seq[i*2][1]) + ' ' + str(seq[i*2+1][0]) + ' ' + str(seq[i*2+1][1]) + '\n')

print(len(seq) - k*2 + 2,end=' ')
for a,b in seq[k*2-2:]:
    sys.stdout.write(str(a) + ' ' + str(b) + ' ')


n, m, k = [int(c) for c in input().split()]

x, y = [1, 1]

def next_cell(x, y):
    if x % 2 == 1 and y < m:
        return [x, y + 1]
    elif x % 2 == 0 and y > 1:
        return [x, y - 1]
    else:
        return [x + 1, y]

for i in range(1, k):
    x2, y2 = next_cell(x, y)
    print(2, x, y, x2, y2)
    x, y = next_cell(x2, y2)

last = [x, y]

req_len = n*m - (k-1)*2

while len(last) < req_len * 2:
    x, y = next_cell(x, y)
    last.append(x)
    last.append(y)

print(len(last) // 2, ' '.join(map(str,last)))

n,m,k=map(int,input().split())
x=1
y=1
a=[[1,1]]
inv=1
z=n*m
while z>1:
    z-=1
    if y<m and inv==1:
        y+=1
    elif y>1 and inv==-1:
        y-=1
    else:
        x+=1
        inv=-inv
    a.append([x,y])
while k>1:
    print(2,*a.pop(),end=' ')
    print(*a.pop())
    k-=1
print(len(a),end=' ')
for i in a:
    print(*i,end=' ')
print()

n,m,k = list(map(int,input().split()))
unit_tube = (n * m) // k
long_tube = (n * m) % k + unit_tube

print(long_tube,end='')
i = 0
j = 0
ref = 0
for _ in range(long_tube):
    print(' {0} {1}'.format(i + 1,abs(j + 1 - ref)),end='')
    if((j + 1) % (m) == 0):
        i+=1
        ref = 0 if(ref) else m + 1
    j = (j + 1) % m
print()
for _ in range(k - 1):
    print(unit_tube,end='')
    for _ in range(unit_tube):
        print(' {0} {1}'.format(i + 1,abs(j + 1 - ref)),end='')
        if((j + 1) % (m) == 0):
            i+=1
            ref = 0 if(ref) else m + 1
        #j = abs((j + 1) % (m) - ref)
        j = (j + 1) % m
    print()
        

n, m, k = map(int,input().split())
x = 1
y = 1
add = 1
for pNum in range(k-1):
    print(2, end = ' ')
    print(x, y, end = ' ')
    y += add
    if y == m+1:
        y = m
        add = -1
        x = x + 1
    if y == 0:
        y = 1
        add = 1
        x = x + 1
    print(x, y, end = ' ')
    y += add
    if y == m+1:
        y = m
        add = -1
        x = x + 1
    if y == 0:
        y = 1
        add = 1
        x = x + 1
    print()
print(n * m - 2 * (k-1), end = ' ')
while x < n+1:
    print(x, y, end = ' ')
    y += add
    if y == m+1:
        y = m
        add = -1
        x = x + 1
    if y == 0:
        y = 1
        add = 1
        x = x + 1
print()

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

s = False

def nex(x, y, s):
	if (y == 1 or y == m) and s:
		return x + 1, y, False
	if x % 2:
		return x, y + 1, True
	return x, y - 1, True

xc = 1
yc = 1
for i in range(k - 1):
	print(2, end = " ")
	print(xc, yc, end = " ")
	xc, yc, s = nex(xc, yc, s)
	print(xc, yc)
	xc, yc, s = nex(xc, yc, s)

print(n * m - (k - 1) * 2, end = " ")
for i in range(n * m - (k - 1) * 2):
	print(xc, yc, end=" ")
	xc, yc, s = nex(xc, yc, s)



n, m, k = map(int, input().split())
d, s, p = 0, [], [list(map(str, range(1, m + 1)))]
p.append(list(reversed(p[0])))
for i in map(str, range(1, n + 1)):
    s += [i + ' ' + j for j in p[d]]
    d = 1 - d
d = 2 * k - 2
for i in range(0, d, 2): print(2, s[i] + ' ' + s[i + 1])
print(n * m - d, ' '.join(s[d: ]))

n, m, k = map(int, input().split())
def z():
  for i in range(n):
    for j in range(m):
      if i % 2 == 0:
        yield i + 1, j + 1
      else:
        yield i + 1, m - j
def p(a):
  print(len(a), ' '.join("{} {}".format(x, y) for x, y in a))
a = list(z())
l = n * m // k
for i in range(k - 1):
  p(a[i * l : (i + 1) * l])
p(a[l * (k - 1):])

# -*- coding: utf-8 -*-
import sys
f = sys.stdin
#f = open('H:\\Portable Python 3.2.5.1\\test_248B1.txt') 
n, m, k  = map(int, f.readline().strip().split())



ki = 1    
ps = []
l = 0
p = []
for i in range(1,n+1): 
    if i % 2 == 0:
        r = range(m,0,-1)
    else :
        r = range(1,m+1)
    for j in r:
        p.append(str(i))
        p.append(str(j))
        l += 1
        if ki<k and l==2:
            ps.append( '2 '+' '.join(p)  )
            l = 0
            p = []
            ki += 1
ps.append( str(l) + ' ' + ' '.join(p) )

print('\n'.join(ps))

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

def printTube(tube):
	print(len(tube), end=' ')
	for cell in tube:
		print(cell[0] + 1, cell[1] + 1, end=' ')
	print()

nbTubes = 0
currTube = []
for i in range(n):
	if i % 2 == 0:
		jDomain = range(m)
	else:
		jDomain = reversed(range(m))

	for j in jDomain:
		currTube.append((i, j))
		if len(currTube) >= 2 and nbTubes < k-1:
			printTube(currTube)
			currTube = []
			nbTubes += 1
printTube(currTube)

n, m, k = [int(x) for x in input().split()]

def walk(n, m):
	for i in range(n):
		if i%2==0:
			for j in range(m):
				yield (i+1, j+1)
		else:
			for j in range(m-1, -1, -1):
				yield (i+1, j+1)

w = walk(n, m)
for s in range(k-1):
	print("2 ", end="")
	print("{} {} ".format(*next(w)), end="")
	print("{} {}".format(*next(w)), end="")
	print()

r = []
while True:
	try:
		r.append(next(w))
	except StopIteration as e:
		break
print("{} ".format(len(r)), end="")
for i in r:
	print("{} {} ".format(*i), end="")
print()



n, m, k = map(int, input().split())
r = []
for i in range(n):
    for j in range(m)[::-(i % 2) * 2 + 1]:
        r += [str(i+1), str(j+1)]

chunk = m*n//k
for i in range(k-1):
    print(chunk, ' '.join(r[2*i*chunk:2*(i+1)*chunk]))

print(len(r)- 2*(k-1)*chunk)//2, ' '.join(r[2*(k-1)*chunk:])

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

def printTube(tube):
    print(len(tube), end=' ')
    for cell in tube:
        print(cell[0] + 1, cell[1] + 1, end=' ')
    print()

nbTubes = 0
currTube = []
for i in range(n):
    if i % 2 == 0:
        jDomain = range(m)
    else:
        jDomain = reversed(range(m))

    for j in jDomain:
        currTube.append((i, j))
        if len(currTube) >= 2 and nbTubes < k-1:
            printTube(currTube)
            currTube = []
            nbTubes += 1
printTube(currTube)

n, m, k = [int(k) for k in input().split()]
total = n * m
length = [int(total/k)]*(k-1)
length.append(total - (int(total/k))*(k-1))
#print(length)
table =[[0]*(n+1) for _ in range(m+1)]
i = 1


path = []
for r in range(1, m+1):
    if r % 2 == 0: #odd rows, go forward
        for c in range(n, 0,-1):
            path.append(c)
            path.append(r)
    else: #even rows, go backwards
        for c in range(1, n+1):
            path.append(c)
            path.append(r)

#print(path)
i = 0    
for l in length:
    print(l, end = " ")
    s = ""
    for x in path[i:i+2*l]:
        s += str(x) + " "
    print(s)
    #print(path[i:i+2*l], end = " ")
    i = i+2*l
   

# 441C

__author__ = 'artyom'

n, m, k = map(int, input().split())
i, j, d, t = 1, 1, 1, 1
ans = ''


def get_next(x, y, dir):
  y += dir
  if y > m:
    y = m
    x += 1
    dir = -1
  if y == 0:
    y = 1
    x += 1
    dir = 1
  return x, y, dir


while t < k:
  ans += '2 ' + str(i) + ' ' + str(j)
  i, j, d = get_next(i, j, d)
  ans += ' ' + str(i) + ' ' + str(j) + '\n'
  i, j, d = get_next(i, j, d)
  t += 1
rem = n * m - (t - 1) * 2
ans += str(rem)
while rem > 0:
  ans += ' ' + str(i) + ' ' + str(j)
  i, j, d = get_next(i, j, d)
  rem -= 1

print(ans)

def addX(x, y):
    if y % 2 == 0:
        x += 1
        if x == m:
            y += 1
            x -= 1
    else:
        x -= 1
        if x == -1:
            y += 1
            x += 1
    return x, y

n, m, k = [int(x) for x in input().split()]
res = []
curx, cury, curk, curlen = 0, 0, 0, 0
for i in range(k-1):
    res.append([])
    for j in range(2):
        res[i].append([cury+1, curx+1])
        curx, cury = addX(curx, cury)
res.append([])
while cury < n:
    res[k-1].append([cury+1, curx+1])
    curx, cury = addX(curx, cury)
print('\n'.join(str(len(x)) + ' ' + ' '.join(' '.join(list(map(str, y))) for y in x) for x in res))
#print(res)


x, y, k = map(int, input().split(' '))

def nxt(lst):
    a = lst[0]
    b = lst[1]
    if not (1<=a<=x and 1<=b<=y):
        return [-420420, -420]
    if a%2 == 1 and b == y:
        return [a+1, b]
    if a%2 == 0 and b == 1:
        return [a+1, b]
    if a%2 == 0:
        return [a, b-1]
    else:
        return [a, b+1]

a = [1, 1]
for i in range(k-1):
    a1 = a[0]
    a2 = a[1]
    a = nxt(a)
    a3 = a[0]
    a4 = a[1]
    a = nxt(a)
    print(2, a1, a2, a3, a4)

xx = []
print(x*y-2*(k-1), end = ' ')
while (nxt(a) != [-420420, -420]):
    print(a[0], a[1], end = ' ')
    a = nxt(a)
    


def main():
    n, m, k = list(map(int, input().split()))
    pipe, res = [], []
    for y in range(1, n + 1):
        for x in list(range(1, m + 1)) if y & 1 else list(range(m, 0, -1)):
            pipe.append(str(y))
            pipe.append(str(x))
    for i in range(0, k * 4 - 4, 4):
        res.append("2 ")
        res.append(' '.join(pipe[i:i + 4]))
        res.append('\n')
    res.append(str(n * m - k * 2 + 2) + ' ')
    res.append(' '.join(pipe[k * 4 - 4:]))
    print(''.join(res))


def __starting_point():
    main()

__starting_point()

#!/usr/bin/env python3
import collections, itertools, fractions, functools, heapq, math, queue

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

  cells = []
  for i in range(n):
    if i%2 == 0:
      for j in range(m):  # left to right
        cells.append((i+1, j+1))
    else:
      for j in range(m, 0, -1):
        cells.append((i+1, j))

  for _ in range(k-1):
    print(2, *cells[-1], *cells[-2])
    cells.pop()
    cells.pop()

  print(len(cells), end=' ')
  for c in cells:
    print(*c, end=' ')
  print()

def __starting_point():
  solve()


__starting_point()

from collections import defaultdict,deque,Counter,OrderedDict

def main():
    n,m,k = map(int,input().split())
    l,ans = [],[]
    for i in range(1,n+1):
        if i%2 == 0:
            for j in range(m,0,-1):
                l.append((i,j))
        else:
            for j in range(1,m+1):
                l.append((i,j))
    curr = 0
    while k > 1:
        ans.append([l[curr][0], l[curr][1], l[curr + 1][0], l[curr + 1][1]])
        curr += 2
        k -= 1
    ans.append([])
    for i in range(curr,len(l)):
        ans[-1].append(l[i][0])
        ans[-1].append(l[i][1])
    for i in ans:
        print(len(i)//2," ".join(map(str,i)))


def __starting_point():
    main()
__starting_point()

'''
def main():
	from sys import stdin,stdout
def __starting_point():
	main()
'''
#Journey to moon
'''
def main():
	from sys import stdin,stdout
	import collections
	N,I =map(int,stdin.readline().split())
	visited=list(0 for x in range(N))
	G=collections.defaultdict(list)
	groups=[0]
	for _ in range(I):
		a,b=map(int,stdin.readline().split())
		G[a].append(b)
		G[b].append(a)
	q=collections.deque()
	flag=0
	for i in range(N):
		if not visited[i]:
			q.append(i)
			visited[i]=flag+1
			groups[flag]+=1
			while len(q):
				top=q.popleft()
				for j in G[top]:
					if visited[j]!=visited[top]:
						visited[j]=flag+1
						groups[flag]+=1
						q.append(j)
			flag+=1
			groups.append(0)
	counter=0
	for i in range(len(groups)-1):
		for j in range(i+1,len(groups)):
			counter+=groups[i]*groups[j]
	stdout.write(str(counter))
def __starting_point():
	main()
'''
#Djikstra's
'''
import collections
class Graph:
	def __init__(self):
		self.nodes=set()
		self.edges=collections.defaultdict(list)
		self.distances = {}

	def add_node(self, value):
		self.nodes.add(value)

	def add_edge(self, from_node, to_node, distance):
		self.edges[from_node].append(to_node)
		self.edges[to_node].append(from_node)
		self.distances[(from_node, to_node)] = distance
		self.distances[(to_node, from_node)] = distance


def dijsktra(graph, initial):
	visited = {initial: 0}
	path = {}

	nodes = set(graph.nodes)

	while nodes:
		min_node = None
		for node in nodes:
			if node in visited:
				if min_node is None:
					min_node = node
				elif visited[node] < visited[min_node]:
					min_node = node

		if min_node is None:
			break

		nodes.remove(min_node)
		current_weight = visited[min_node]

		for edge in graph.edges[min_node]:
			weight = current_weight + graph.distances[(min_node, edge)]
			if edge not in visited or weight < visited[edge]:
				visited[edge] = weight
				path[edge] = min_node

	return visited, path

def main():
	from sys import stdin,stdout
	for _ in range(int(stdin.readline())):
		n,m=map(int,stdin.readline().split())
		G=Graph()
		for i in range(n):
			G.add_node(i+1)
		for i in range(m):
			a,b,c=map(int,stdin.readline().split())
			G.add_edge(a,b,c)
		initial=int(stdin.readline())
		v,p=dijsktra(G, initial)
		#print(v)
		#print(p)
		for i in range(1,n+1):
			if i!=initial:
				k=v.get(i,-1)
				stdout.write(str(k)+' ')
		stdout.write('\n')
def __starting_point():
	main()
'''
#Larget pallindrome in String
'''
def main():
	from sys import stdin,stdout
	string=stdin.readline().strip()
	l=len(string)
	#Triangle logic	
	
	arrlen=(l*(l-1))//2
	arr=list(0 for x in range(arrlen))
	f=0
	c=l-1
	for i in range(l-1):
		for j in range(i+1,l):
			if string[i]==string[j]:
				arr[f+j-i-1]=1
		f+=c
		c-=1
	#print(arr)
	if any(arr):
		
	else:
		if l & 1:
			stdout.write('First')
		else:
			stdout.write('Second')
	#2-d Array Logic
	arr=list(list(0 for i in range(l)) for j in range(l))
	for i in range(l):
		for j in range(l):
			if string[i]==string[j]:
				arr[i][j]=1
	maxim=0
	for i in range(0,l*(l-1)-2,l+1):
		a,b=i+1,i+2
		#print(a,b)
		acount=0
		x=a//5
		y=a%5
		acount=arr[x][y]		
		x-=1
		y-=1
		while x>=0 and y>=0:
			acount+=arr[x][y]
			x-=1
			y-=1
		x=b//5
		y=b%5
		bcount=arr[x][y]		
		x-=1
		y-=1
		while x>=0 and y>=0:
			bcount+=arr[x][y]
			x-=1
			y-=1
		maxim=max((acount,bcount,maxim))
	maxim=max(maxim,arr[l-2][l-1])
	maxim=(maxim<<1)^1
	delta=l-maxim
	if delta & 1:
		stdout.write('Second')
	else:
		stdout.write('First')
def __starting_point():
	main()
'''
#276B
'''
def main():
	from sys import stdin,stdout
	import collections
	s=stdin.readline().strip()
	count=collections.Counter(s)
	l=list(filter(lambda x: count[x] & 1,list(x for x in count)))
	removed=sum(list(count[x] for x in l))-max(list(count[x] for x in l)+[0])
	if removed & 1:
		stdout.write('Second')
	else:
		stdout.write('First')
def __starting_point():
	main()
'''
#362B
'''
def main():
	from sys import stdin,stdout
	n,m=map(int,stdin.readline().split())
	if m:
		dirty=sorted(map(int,stdin.readline().split()))
		if dirty[0]==1 or dirty[-1]==n:
			stdout.write('NO')
		else:
			flag=True
			for i in range(m-2):
				if dirty[i+1]==dirty[i]+1 and dirty[i+2]==dirty[i]+2:
					flag=False
					break
			if flag:
				stdout.write('YES')
			else:
				stdout.write('NO')
	else:
		stdout.write('YES')
def __starting_point():
	main()
'''
#279B SUM OF SUB-ARRAY
'''
def main():
	from sys import stdin,stdout
	n,t=map(int,stdin.readline().split())
	arr=list(map(int,stdin.readline().split()))
	maxim=0
	curr_sum=arr[0]
	i=0
	j=1
	if curr_sum <=t:
		count=1
	else:
		curr_sum=0
		count=0
		i=1
		j=2
	while j<n:
		if curr_sum+arr[j]<=t:
			count+=1
			curr_sum+=arr[j]
			j+=1
		else:
			maxim=max(count,maxim)
			if curr_sum:
				curr_sum-=arr[i]
				count-=1
			else:
				j+=1
			i+=1
	maxim=max(count,maxim)
	stdout.write(str(maxim))
def __starting_point():
	main()
'''
#469B
'''
def main():
	from sys import stdin,stdout
	p,q,l,r=map(int,stdin.readline().split())
	a=[]
	b=[]
	visited=list(0 for x in range(r-l+1))
	#print(visited)	
	for i in range(p):
		x,y=map(int,stdin.readline().split())
		a.append(x)
		b.append(y)
	for i in range(q):
		x,y=map(int,stdin.readline().split())
		x+=l
		y+=l
		for j in range(p):
			#print('x=',x,'y=',y)
			lower=max(0,a[j]-y)
			upper=min(b[j]-x,r)+1
			if upper > lower:
				delta=upper-lower
				#print('upper=',upper,'lower=',lower)
				visited[lower:upper]=list(1 for x in range(delta))
				#print('visited:\n',visited)
	#	print(visited)
	stdout.write(str(visited[:r-l+1].count(1)))
def __starting_point():
	main()
'''
'''
def main():
	from sys import stdin,stdout
	#import numpy as np
	n,k=map(int,stdin.readline().split())
	a=tuple(map(int,stdin.readline().split()))
	minim=min(a)
	maxim=max(a)
	arr=list(a)	
	for i in range(n):
		arr[i]-=minim
	if max(arr) > k:
		stdout.write('NO')
	else:
		stdout.write('YES\n')
		for i in a:
			stdout.write('1 '*minim)
			for j in range(i-minim):
				stdout.write(str(j%k+1)+' ')
			stdout.write('\n')
def __starting_point():
	main()
'''
'''
def main():
	from sys import stdin,stdout
	n,p=[],[]
	for _ in range(int(stdin.readline())):
		last=int(stdin.readline())
		if last<0:
			n.append(-1*last)
		else:
			p.append(last)
	if sum(p)>sum(n):
		stdout.write('first')
	elif sum(n)>sum(p):
		stdout.write('second')
	else:
		maxim=max(n,p)
		#print(maxim)
		if maxim==p:
			if maxim==n:
				if last<0:
					stdout.write('second')
				else:
					stdout.write('first')
			else:
				stdout.write('first')
		else:
			stdout.write('second')
		
def __starting_point():
	main()
'''
#286C
'''
def main():
	from sys import stdin,stdout
	m,n=map(int,stdin.readline().split())
	minim=min(m,n)
	stdout.write(str(minim+1)+'\n')
	if n==minim:
		for i in range(minim+1):
			stdout.write(str(m)+' '+str(i)+'\n')
			m-=1
	else:
		for i in range(minim+1):
			stdout.write(str(i)+' '+str(n)+'\n')
			n-=1
def __starting_point():
	main()
'''
#387B
'''
def main():
	from sys import stdin,stdout
	n,m=map(int,stdin.readline().split())
	a=tuple(map(int,stdin.readline().split()))
	b=tuple(map(int,stdin.readline().split()))
	i=0
	j=0
	while True:
		#print(i,j)
		if i>=n or j>=m:
			break
		if b[j]>=a[i]:
			i+=1
			j+=1
		else:
			j+=1
	stdout.write(str(n-i))
def __starting_point():
	main()
'''
#365B
'''
def main():
	from sys import stdin,stdout
	n=int(stdin.readline())
	a=tuple(map(int,stdin.readline().split()))
	maxim=2
	count=2
	i=2
	while True:
		if i>=n:
			break
		if a[i]==a[i-1]+a[i-2]:
			count+=1
			maxim=max(count,maxim)
		else:
			count=2
		i+=1
	stdout.write(str(min(maxim,n)))
def __starting_point():
	main()
'''	#474D
'''
def main():
	from sys import stdin,stdout
	MOD=int(1e9)+7
	T,k=map(int,stdin.readline().split())
	fib=[x for x in range(1,k+1)]
	for i in range(k,100001):
		fib.append((fib[i-1]+fib[i-k]+1)%MOD)
	for _ in range(T):
		a,b=map(int,stdin.readline().split())
		stdout.write(str((fib[b]-fib[a-1])%MOD)+'\n')
def __starting_point():
	main()
'''
#330B
#not working
'''
def main():
	from sys import stdin,stdout
	import collections
	road_not=collections.defaultdict(set)
	n,m=map(int,stdin.readline().split())
	for _ in range(m):
		a,b=map(int,stdin.readline().split())
		road_not[a].add(b)
		road_not[b].add(a)
	counter=0
	road=collections.defaultdict(set)
	visited=[0 for x in range(n)]
	visited[0]=True
	for index in range(1,n+1):
		for i in range(1,n+1):
			if not visited[i-1]:
				if i not in road_not[index] and i!=index:
					counter+=1
					road[index].add(i)
					visited[i-1]=True
	stdout.write(str(counter)+'\n')
	for i in road:
		for j in road[i]:
			stdout.write(str(i)+' '+str(j)+'\n')
def __starting_point():
	main()
'''
#208D
'''
def main():
	from sys import stdin,stdout
	import bisect
	n=int(stdin.readline())
	p=tuple(map(int,stdin.readline().split()))
	P=tuple(map(int,stdin.readline().split()))
	record=[0 for x in range(5)]
	points=0
	for i in p:
		points+=i
		while points>=P[0]:
			index=bisect.bisect_right(P,points)
			if index:
				index-=1
				number=points//P[index]
				record[index]+=number
				points-=P[index]*number
	for i in record:
		stdout.write(str(i)+' ')
	stdout.write('\n'+str(points))
def __starting_point():
	main()
'''
#339D Using Al.Cash's Segment Trees
#Segment Tree
#not-working
'''
powers=1
t=[0 for x in range(3*int(1e5))]
def build(n):
	nonlocal t,powers
	flag=False
	for i in range(n-1,0,-1):
		if i==powers-1:
			flag=not flag
			powers>>=1
		if flag:
			t[i]=t[i<<1]^t[i<<1|1]
		else:
			t[i]=t[i<<1]|t[i<<1|1]

def modify(i,v,n):
	nonlocal t
	flag=False
	if t[i+n-1]==v or v|t[(i+n-1)^1]==t[(i+n-1)>>1]:
		#print('skipped')
		#print('t[i+n-1]=',t[i+n-1],'v=',v)
		#print('v|t[(i+n-1)^1]=',v|t[(i+n-1)^1],'t[(i+n-1)>>1]',t[(i+n-1)>>1])		
		t[i+n-1]=v		
		return
	t[i+n-1]=v
	p=i+n-1
	while p>1:
		if flag:
			if t[p>>1]==t[p]^t[p^1]:
				break
			t[p>>1]=t[p]^t[p^1]
			flag=not flag
		else:
			if t[p>>1]==t[p]|t[p^1]:
				break
			t[p>>1]=t[p]|t[p^1]
			flag=not flag
		p>>=1

def main():
	from sys import stdin,stdout
	nonlocal t,powers
	n,m=map(int,stdin.readline().split())
	p=tuple(map(int,stdin.readline().split()))
	powers=1<<(n-1)	
	n=1<<(n)	
	for i in range(n):
		t[i+n]=p[i]
	build(n)
	#print(t[:2*n])
	for _ in range(m):
		a,b=map(int,stdin.readline().split())
		modify(a,b,n)
		#print(t[:2*n])
		stdout.write(str(t[1])+'\n')
def __starting_point():
	main()
'''
#330B
'''
def main():
	from sys import stdin,stdout
	n,m=map(int,stdin.readline().split())
	start_not=set()
	for _ in range(m):
		a,b=map(int,stdin.readline().split())
		start_not.add(a-1)
		start_not.add(b-1)
	visited=[False for _ in  range(n)]
	for i in range(n):
		if i not in start_not:
			center=i
			break
	stdout.write(str(n-1)+'\n')
	for i in range(n):
		if i != center:
			stdout.write(str(center+1)+' '+str(i+1)+'\n')
def __starting_point():
	main()
'''
#116B
'''
def main():
	from sys import stdin,stdout
	n,m=map(int,stdin.readline().split())
	arr=[]
	for _ in range(n):
		arr.append(stdin.readline().strip())
	pigs=set()
	count=0
	for i in range(n):
		for j in range(m):
			if arr[i][j]=='W':
				flag=0
				if i>0:
					if arr[i-1][j]=='P':
						pigs.add((i-1,j))
						flag=1
				if i<n-1:
					if arr[i+1][j]=='P':
						pigs.add((i+1,j))
						flag=1
				if 	j>0:
					if arr[i][j-1]=='P':
						pigs.add((i,j-1))
						flag=1
				if j<m-1:
					if arr[i][j+1]=='P':
						pigs.add((i,j+1))
						flag=1
				if flag:
					count+=1
	stdout.write(str(min(len(pigs),count)))
def __starting_point():
	main()
'''
#339D using Al.Cash's Segment Tree Implementation
'''
def main():
	from sys import stdin,stdout
	answers=()
	n,m=map(int,stdin.readline().split())
	p=tuple(map(int,stdin.readline().split()))
	powers=1<<(n-1)
	n=powers<<1
	t=[0 for _ in range(n<<1)]
	for i in range(n):
		t[n+i]=p[i]
	flag=False
	for i in range(n-1,0,-1):
		if i==powers-1:
			flag=not flag
			powers>>=1
		if flag:
			t[i]=t[i<<1]^t[i<<1|1]
		else:
			t[i]=t[i<<1]|t[i<<1|1]
	for _ in range(m):
		a,b=map(int,stdin.readline().split())
		flag=False
		if t[a+n-1]==b or b|t[(a+n-1)^1]==t[(a+n-1)>>1]:
			t[a+n-1]=b
		else:
			t[a+n-1]=b
			p=a+n-1
			while p > 1:
				if flag:
					if t[p>>1]==t[p]^t[p^1]:
						break
					t[p>>1]=t[p]^t[p^1]
					flag=not flag
				else:
					if t[p>>1]==t[p]|t[p^1]:
						break
					t[p>>1]=t[p]|t[p^1]
					flag= not flag
				p>>=1
		stdout.write(str(t[1])+'\n')
def __starting_point():
	main()
'''
#515C
'''
def main():
	from sys import stdin,stdout
	import collections
	nc=[0 for x in range(10)]
	n=int(stdin.readline())
	num=stdin.readline().strip()
	for i in num:
		k=int(i)
		if k==9:
			nc[7]+=1
			nc[3]+=2
			nc[2]+=1
		elif k==8:
			nc[7]+=1
			nc[2]+=3
		elif k==7:
			nc[7]+=1
		elif k==6:
			nc[5]+=1
			nc[3]+=1
		elif k==5:
			nc[5]+=1
		elif k==4:
			nc[3]+=1
			nc[2]+=2
		elif k==3:
			nc[3]+=1
		elif k==2:
			nc[2]+=1
	ans=''
	for i in range(10):
		ans+=str(9-i)*nc[9-i]
	stdout.write(ans)		
def __starting_point():
	main()
'''
#313B
'''
def main():
	from sys import stdin,stdout
	s=stdin.readline().strip()
	flag=s[0]
	if flag=='.':
		anti='#'
	else:
		anti='.'
	n=len(s)
	l=[0 for x in range(n)]
	for i in range(1,n):
		if s[i]==flag:
			l[i]=l[i-1]+1
		else:
			flag,anti=anti,flag
			l[i]=l[i-1]
	#print(l)
	for _ in range(int(stdin.readline())):
		a,b=map(int,stdin.readline().split())
		stdout.write(str(l[b-1]-l[a-1])+'\n')
def __starting_point():
	main()
'''
#431C
'''
def main():
	from sys import stdin,stdout
	MOD=int(1e9)+7
	n,k,d=map(int,stdin.readline().split())
	d-=1
	klist=[(1<<i)%MOD for i in range(k)]
	klist=[1]+klist
	for i in range(k+1,n+1):
		klist.append((klist[i-1]*2-klist[i-1-k])%MOD)
	if d:	
		dlist=[(1<<i)%MOD for i in range(d)]
		dlist=[1]+dlist
		for i in range(d+1,n+1):
			dlist.append((dlist[i-1]*2-dlist[i-1-d])%MOD)
	#print(klist)
	#print(dlist)
		ans=klist[n]-dlist[n]
	else:
		ans=klist[n]
	stdout.write(str(ans%MOD))
def __starting_point():
	main()
'''
#441C
def main():
	from sys import stdin,stdout
	n,m,k=list(map(int,stdin.readline().split()))
	if n>=m:
		i=-1
		j=-1
		num=n*m
		while k:
			ans=num//k
			stdout.write(str(ans)+' ')
			counter=0
			while counter<ans:
				if j==-1:
					flag=True
					i+=1
					j+=1
				if j==m:
					flag=False
					i+=1
					j-=1
				stdout.write(str(i+1)+' '+str(j+1)+' ')
				if flag:
					j+=1
				else:
					j-=1
				counter+=1
			num-=ans
			k-=1
			stdout.write('\n')
	else:
		i=-1
		j=-1
		num=n*m
		while k:
			ans=num//k
			stdout.write(str(ans)+' ')
			counter=0
			while counter<ans:
				if i==-1:
					flag=True
					j+=1
					i+=1
				if i==n:
					flag=False
					j+=1
					i-=1
				stdout.write(str(i+1)+' '+str(j+1)+' ')
				if flag:
					i+=1
				else:
					i-=1
				counter+=1
			num-=ans
			k-=1
			stdout.write('\n')
def __starting_point():
	main()

__starting_point()

from sys import stdin
firstline = stdin.readline().rstrip().split()
rows = int(firstline[0])
cols = int(firstline[1])
k = int(firstline[2])

flip = True
flat_matrix=[]
for row in range(rows):
    col_traversal = (range(cols-1, -1, -1), range(cols))[flip]
    for col in col_traversal:
        flat_matrix.append((row+1, col+1))
    flip = not flip

point = 0
for tube in range(k):
    if tube != k-1:
        print("2 ", end='')
        for cell in range(2):
            point + cell
            print(str(flat_matrix[point+cell][0]) + " " + str(flat_matrix[point+cell][1]) + " ", end='')
        point += 2
        print()
    else:
        print(str(len(flat_matrix)-point) + " ", end='')
        for cell in range(len(flat_matrix)-point):
            print(str(flat_matrix[point+cell][0]) + " " + str(flat_matrix[point+cell][1]) + " ", end='')
print()


import sys

def main():
    (n, m, k) = list(map(int, sys.stdin.readline().split(' ')))
    l = []
    alt = False
    for i in range(n):
        if not alt:
            for j in range(m):
                l.append((i + 1, j + 1))
        else:
            for j in range(m - 1, -1, -1):
                l.append((i + 1, j + 1))
        alt ^= True
    length = (n * m) // k
    i = 0
    for j in range(1, k + 1):
        g = l[i:j*length]
        if j == k:
            g = l[i:]
        s = ' '.join(list([' '.join(map(str, x)) for x in g]))
        sys.stdout.write('{} {}\n'.format(len(g), s))
        i = j * length

main()