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
#sys.setrecursionlimit(10**7)
input = sys.stdin.readline

############ ---- Input Functions ---- ############
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) - 1]))
def invr():
    return(map(int,input().split()))
############ ---- Input Functions ---- ############

def Valera_and_Tubes():
    n ,m ,k = invr()

    number_of_cells_for_first_pipe = (n*m) - ((2*k) - 2)
    total_cells = n*m 

    pipe_number = 1 
    cells = {}
    cells[pipe_number] = []
    cells_occupied = 0

    for cell_number in range(1,total_cells+1):
        cell_pos = cell_number - 1
        
        row_index = cell_pos // m 
        if row_index % 2 == 0:
            col_index = cell_pos - (row_index*m)
        else:
            col_index = m - (cell_pos - (row_index*m)) - 1 
        
        if pipe_number == 1:
            cells[pipe_number].append(row_index+1)
            cells[pipe_number].append(col_index+1)
            cells_occupied += 1 

            if cells_occupied == number_of_cells_for_first_pipe:
                pipe_number = 2 
                cells[pipe_number] = []
                cells_occupied = 0 
        
        else:
            cells[pipe_number].append(row_index+1)
            cells[pipe_number].append(col_index+1)
            cells_occupied += 1 

            if cells_occupied == 2:
                pipe_number += 1
                cells[pipe_number] = []
                cells_occupied = 0

    outputStr = ''
    for pipe_number in range(1,k+1):
        outputStr += str(len(cells[pipe_number])//2) + ' '
        new_str = ' '.join(str(x) for x in cells[pipe_number])
        outputStr += new_str + '\n'
    
    outputStr = outputStr.strip()
    print(outputStr)

    return

Valera_and_Tubes()