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*<sub class="lower-index">1</sub>, *y*<sub class="lower-index">1</sub>), (*x*<sub class="lower-index">2</sub>, *y*<sub class="lower-index">2</sub>), ..., (*x*<sub class="lower-index">*r*</sub>, *y*<sub class="lower-index">*r*</sub>), that: 
 -  *r* ≥ 2; -  for any integer *i* (1 ≤ *i* ≤ *r* - 1) the following equation |*x*<sub class="lower-index">*i*</sub> - *x*<sub class="lower-index">*i* + 1</sub>| + |*y*<sub class="lower-index">*i*</sub> - *y*<sub class="lower-index">*i* + 1</sub>| = 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.
The first line contains three space-separated integers *n*, *m*, *k* (2 ≤ *n*, *m* ≤ 300; 2 ≤ 2*k* ≤ *n*·*m*) — the number of rows, the number of columns and the number of tubes, correspondingly.
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect, insort
from time import perf_counter
from fractions import Fraction
import copy
from copy import deepcopy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def L(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]
try:
    # sys.setrecursionlimit(int(pow(10,6)))
    sys.stdin = open("input.txt", "r")
    # sys.stdout = open("output.txt", "w")
except:
    pass
def pmat(A):
    for ele in A: print(*ele,end="\n")


def dfs(num,x,y,l):
    # print(num,x,y,l)
    if l==0:
        return
    vis[x][y]=num+1
    if len(f)<=num:
        f.append([])
    f[-1].append([x+1,y+1])
    r=[-1,0,0,1]
    c=[0,-1,1,0]
    for z in range(4):
        a=x+r[z]
        b=y+c[z]
        if 0<=a<n and 0<=b<m and vis[a][b]==0:
            dfs(num,a,b,l-1)
            return
n,m,k=L()
f=[]
l=(n*m)//k
ln=[l for i in range(k)]
ln[-1]+=((n*m)%k)
vis=[[0 for i in range(m)] for j in range(n)]
for cur in range(k):

    for i in range(n):
        for j in range(m):
            if vis[i][j]==0:
                dfs(cur,i,j,ln[cur])
                break 
        else:
            continue
        break
# print(f,vis)
for ele in f:
    print(len(ele),end=" ")
    for x in ele:
        print(*x,end=" ")
    print()