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.
# 2022-03-05 17:15:17.986835
# https://codeforces.com/problemset/problem/441/C
import sys

_DEBUG = True
if not _DEBUG:
    input = sys.stdin.readline
    # print = sys.stdout.write

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


def proc(n, m, k):
    t = [[False] * (m + 2) for _ in range(n + 2)]
    for i in range(n + 2):
        t[i][0] = t[i][m + 1] = True
    for i in range(m + 2):
        t[0][i] = t[n + 1][i] = True

    paths = []

    next_x = next_y = 1
    for i in range(k - 1):
        path = []
        x, y = next_x, next_y

        if i < k - 1:
            if x == n:
                path = [(x, y), (x, y + 1)]
                next_y += 2
                t[x][y] = t[x][y + 1] = True
            else:
                path = [(x, y), (x + 1, y)]
                next_y += 1
                if next_y > m:
                    next_x += 2
                    next_y = 1
                t[x][y] = t[x + 1][y] = True
        paths.append(path)

    t[next_x][next_y] = True
    dx, dy = [-1, 0, 1, 0], [0, 1, 0, -1]
    stack = [(next_x, next_y)]
    last_path = [(next_x, next_y)]
    while stack:
        x, y = stack.pop()
        for i in range(4):
            next_x, next_y = x + dx[i], y + dy[i]
            if t[next_x][next_y]:
                continue
            last_path.append((next_x, next_y))
            t[next_x][next_y] = True
            stack.append((next_x, next_y))
            break
    paths.append(last_path)
    return paths


ans = proc(n, m, k)
for path in ans:
    print('{} {}'.format(len(path), ' '.join(map(lambda x: '{} {}'.format(*x), path))))