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.
def nCr(n, r):
    return (fact(n) / (fact(r)
                       * fact(n - r)))


# Returns factorial of n
def fact(n):
    res = 1

    for i in range(2, n + 1):
        res = res * i

    return res

mod =10**4

#ncm+ncm-1+ncm-2


ans=0


def nextPowerOf2(n):
    count = 0

    # First n in the below
    # condition is for the
    # case where n is 0
    if (n and not (n & (n - 1))):
        return n

    while (n != 0):
        n >>= 1
        count += 1

    return 1 << count
from collections import defaultdict
import math


def primeFactors(n):
    # Print the number of two's that divide n
    res=set()
    while n % 2 == 0:
        res.add(2)
        n = n // 2

    # n must be odd at this point
    # so a skip of 2 ( i = i + 2) can be used
    for i in range(3, int(math.sqrt(n)) + 1, 2):

        # while i divides n , print i and divide n
        while n % i == 0:
            res.add(i)
            n = n // i

    # Condition if n is a prime
    # number greater than 2
    if n > 2:
        res.add(n)
    return res


def upper_bound(arr, target):
    start = 0
    end = len(arr) - 1

    ans = -1
    while (start <= end):
        mid = (start + end) // 2

        # Move to right side if target is
        # greater.
        if (arr[mid] <= target):
            start = mid + 1

        # Move left side.
        else:
            ans = mid
            end = mid - 1

    return ans

def func(n,s,k,state,dp):
    if(n==0 and state):
        return 1
    if(n<0 or (n==0 and state==False)):
        return 0
    if(dp[state][n]!=-1):
        return dp[state][n]
    ans=0
    for i in range(1,k+1):
        ans+=func(n-i,s,k,state or (i>=s),dp)
    dp[state][n]=ans
    return ans



def fact(n):
    ans=1
    mod=10**9+7
    for i in range(1,n+1):
        ans=(ans*i)
        ans=ans%mod
    return ans

for _ in range(1):
    #k=int(input())
    # n=int(input())
    n,m,k=list(map(int,input().split()))
    # s=input()
    # ans=0
    i,j=0,0
    lis=[[True for i in range(m)] for j in range(n)]
    ans=[]
    # print(*lis)
    # ans.append((i,j))
    while(1):
        if(lis[i][j]==False):
            break
        while(j<m and lis[i][j]):
            lis[i][j]=False
            ans.append((i+1, j+1))
            j+=1
        j-=1
        i+=1
        # print(*lis)
        # print(i,j,lis[i][j])
        while(i<n and lis[i][j]):
            lis[i][j]=False
            ans.append((i+1, j+1))
            i+=1
        i-=1
        j-=1
        while(i>=0 and lis[i][j]):
            lis[i][j]=False
            ans.append((i+1, j+1))
            j-=1
        i-=1
        j+=1
        while(i>=0 and lis[i][j]):
            lis[i][j]=False
            ans.append((i+1, j+1))
            i-=1
        i+=1
        j+=1
    st=set()
    d=defaultdict(int)
    j=0
    for i in range(k):
        if(i!=k-1):
            print(1,*ans[j])
            j+=1
        else:
            print((n*m)-j,end=" ")
            for ele in ans[j:]:
                print(*ele,end=" ")
    print()
