#include<bits/stdc++.h>
using namespace std;
#define ll long long int
typedef pair<int, int> pi;
const int M = 1e8;
int n, m, k, dots = 0, cou = 0;
vector<vector<int>> v;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int nxti = 0, nxtj = 0;

int isvalid(int x, int y)
{
	return x < n && x >=0 && y < m && y >= 0 && !v[x][y];
}

void dfs(int x, int y)
{
	nxti = x; nxtj = y;
	v[x][y] = 1;
	cout << x+1 << " " << y + 1 << " ";
	for(int i = 0; i < 4; i++)
	{
		if(isvalid(x + dx[i], y + dy[i]))
			dfs(x+dx[i], y+dy[i]);
	}
}

void dfs2(int x, int y)
{
	nxti = x; nxtj = y;
	if(cou == 2)
		return;
	cou++;
	v[x][y] = 1;
	cout << x+1 << " " << y + 1 << " ";
	for(int i = 0; i < 4; i++)
	{
		if(isvalid(x + dx[i], y + dy[i]))
			dfs2(x+dx[i], y+dy[i]);
	}
}

int main()
{

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll i, q, p, mn = INT_MAX, mx = 1,j, cnt=0, b = -1, x, y, t, sum = 0, val = 0;
	cin >> n >> m >> k;
	v.resize(n);
	for(i = 0; i < n; i++)
	{
		v[i].resize(m, 0);
	}

	// first print out k-1 in pairs, then make the last one a 1 long tube

	for(i = 0; i < k-1; i++)
	{
		cou = 0;
		cout << 2 << " ";
		dfs2(nxti, nxtj);
		cout << endl;
	}

	// now leftover ppl in last component
	cout << n*m - 2*(k-1) << " ";
	dfs(nxti, nxtj);

}


#include<bits/stdc++.h>
#include<assert.h>
using namespace std;
#define ll long long int

int n, m, k, flag;
int vis[305][305];
int dr[] = {0, 0, 1, -1};
int dc[] = {1, -1, 0, 0};
pair<int, int> nextp;

int isvalid(int i, int j)
{
        return (i >= 0 && i < n && j>= 0 && j < m && !vis[i][j]);
}

void dfs(int x, int y, int cnt)
{
        //cout << endl << "dfs: x and y : " << x << " " << y  << " " << cnt << endl;
        if(cnt == 0 || vis[x][y])
        {
                flag = 1;
                return;
        }
        vis[x][y] = 1;
        cout << x + 1 << " " << y + 1 << " ";
        for(int i = 0; i < 4; i++)
        {
                int nextx = x + dr[i], nexty = y + dc[i];
                if(isvalid(nextx, nexty))
                {
                        nextp = {nextx, nexty};
                        dfs(nextx, nexty, cnt-1);
                        if(flag)
                                return;
                }
        }

}

int main()
{

#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output2.txt", "w", stdout);
#endif

        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        ll nn, i, j = 0, nm = 0, cou = 0, sum = 0;
        ll mx = INT_MIN, mn = INT_MAX, lz=0, rz=0, lo=0, ro=INT_MAX, mi = 0;
        ll mid, l, nk;
        ll x, y, z = 0, merged = 0, add = 0, f = 0;
        ll r, a = 0, d, q, ff = 0, found = 0, p = 0, avg, ind = 0, cnt = 0;
        cin >> n >> m >> k;
        int rem = n*m;
        nextp = {0, 0};
        while(rem)
        {
                i = nextp.first, j = nextp.second;
                flag = 0;
                if(k > 1)
                {
                        rem -= 2;
                        k--;
                        cout << 2 << " ";
                        dfs(i, j, 2);
                        cout << endl;

                }
                else
                {
                        cout << rem << " ";
                        dfs(i, j, rem);
                        cout << " ";
                        rem = 0;
                        k--;
                }
        }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
typedef pair<int, int> pi;
const int M = 1e8;
int n, m, k, dots = 0, cou = 0;
vector<vector<int>> v;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int nxti = 0, nxtj = 0;

int isvalid(int x, int y)
{
	return x < n && x >=0 && y < m && y >= 0 && !v[x][y];
}

void dfs(int x, int y)
{
	nxti = x; nxtj = y;
	if(!v[x][y])
	{
		cou++;
		cout << x+1 << " " << y + 1 << " ";
	}
	v[x][y] = 1;

	for(int i = 0; i < 4; i++)
	{
		if(isvalid(x + dx[i], y + dy[i]))
			dfs(x+dx[i], y+dy[i]);
	}
}

void dfs2(int x, int y)
{
	//cout << "now,im,at: " << x << " " << y << "  " << cou << endl;

	if(cou == 2)
		return;
	nxti = x; nxtj = y;
	if(!v[x][y])
	{
		cou++;
		cout << x+1 << " " << y + 1 << " ";
	}
	v[x][y] = 1;
	for(int i = 0; i < 4; i++)
	{
		if(isvalid(x + dx[i], y + dy[i]))
			dfs2(x+dx[i], y+dy[i]);
	}
}

int main()
{

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll i, q, p, mn = INT_MAX, mx = 1,j, cnt=0, b = -1, x, y, t, sum = 0, val = 0;
	cin >> n >> m >> k;
	v.resize(n);
	for(i = 0; i < n; i++)
	{
		v[i].resize(m, 0);
	}

	// first print out k-1 in pairs, then make the last one a 1 long tube

	for(i = 0; i < k-1; i++)
	{
		cou = 0;
		cout << 2 << " ";
		//cout << "Going for new dfs now :::::::::::::::::::   " << nxti << " " << nxtj << endl;
		dfs2(nxti, nxtj);
		cout << endl;
	}

	// now leftover ppl in last component
	cout << n*m - 2*(k-1) << " ";
	dfs(nxti, nxtj);

}


#include <bits/stdc++.h>

using namespace std;

typedef pair<int,int> pii;

#define oi cout << "oi" << endl;

const int MAXN = 5500, MAXM = 5500;

int ii = 1,jj = 1;
int n,m,k;
bool backCondition = false,forwardCondition = true,ok = false;

vector<pii> v[MAXN];

int mtr[MAXN][MAXM];
int cont = 0;

void dfs(int x){
	mtr[ii][jj] = x;
	cont++;
	v[x].push_back({ii,jj});

	while(true){

		if(jj == m && forwardCondition){
			ii++;
			backCondition = true;
			forwardCondition = false;
			break;
		}
		if(jj == 1 && backCondition){
			ii++;
			backCondition = false;
			forwardCondition = true;
			break;
		}

		if(backCondition && jj != 1){
			jj--;
			break;
		}
		if(forwardCondition && jj != m){
			jj++;
			break;
		}
	}

	mtr[ii][jj] = x;
	cont++;
	v[x].push_back({ii,jj});

	while(true){

		if(jj == m && forwardCondition){
			ii++;
			backCondition = true;
			forwardCondition = false;
			break;
		}
		if(jj == 1 && backCondition){
			ii++;
			backCondition = false;
			forwardCondition = true;
			break;
		}

		if(backCondition && jj != 1){
			jj--;
			break;
		}
		if(forwardCondition && jj != m){
			jj++;
			break;
		}
	}

}

int dir[5] = {-1,0,1,0,-1};

void dfs2(int x){

	while(true){
//		cout << ii << " " << jj << endl;

		mtr[ii][jj] = x;
		v[x].push_back({ii,jj});
		cont++;

		if(cont == m*n) break;

		while(true){

			if(jj == m && forwardCondition){
				ii++;
				backCondition = true;
				forwardCondition = false;
				break;
			}
			if(jj == 1 && backCondition){
				ii++;
				backCondition = false;
				forwardCondition = true;
				break;
			}

			if(backCondition && jj != 1){
				jj--;
				break;
			}
			if(forwardCondition && jj != m){
				jj++;
				break;
			}
		}

		mtr[ii][jj] = x;
		cont++;
		v[x].push_back({ii,jj});

		if(cont == m*n) break;

		while(true){

			if(jj == m && forwardCondition){
				ii++;
				backCondition = true;
				forwardCondition = false;
				break;
			}
			if(jj == 1 && backCondition){
				ii++;
				backCondition = false;
				forwardCondition = true;
				break;
			}

			if(backCondition && jj != 1){
				jj--;
				break;
			}
			if(forwardCondition && jj != m){
				jj++;
				break;
			}

		}
	}
}

int main(){

	scanf("%d %d %d",&n,&m,&k);

	for(int i = 1;i <= k;i++){

		if(i != k)
			dfs(i);
		else
			dfs2(i);
	}

/*
	for(int i = 1;i <= n;i++){
		for(int j = 1;j <= m;j++){
			printf("%d ",mtr[i][j]);
		}
		printf("\n");
	}
*/

	for(int i = 1;i <= k;i++){
		printf("\n%d ",v[i].size());
		for(int j = 0;j < v[i].size();j++){
			printf("%d %d ",v[i][j].first,v[i][j].second);
		}
	}

}


#include <bits/stdc++.h>

using namespace std;

typedef pair<int,int> pii;

#define oi cout << "oi" << endl;

const int MAXN = 500, MAXM = 500;

int ii = 1,jj = 1;
int n,m,k;
bool backCondition = false,forwardCondition = true,ok = false;

vector<pii> v[MAXN];

int mtr[MAXN][MAXM];
int cont = 0;

void dfs(int x){
	mtr[ii][jj] = x;
	cont++;
	v[x].push_back({ii,jj});

	while(true){

		if(jj == m && forwardCondition){
			ii++;
			backCondition = true;
			forwardCondition = false;
			break;
		}
		if(jj == 1 && backCondition){
			ii++;
			backCondition = false;
			forwardCondition = true;
			break;
		}

		if(backCondition && jj != 1){
			jj--;
			break;
		}
		if(forwardCondition && jj != m){
			jj++;
			break;
		}
	}

	mtr[ii][jj] = x;
	cont++;
	v[x].push_back({ii,jj});

	while(true){

		if(jj == m && forwardCondition){
			ii++;
			backCondition = true;
			forwardCondition = false;
			break;
		}
		if(jj == 1 && backCondition){
			ii++;
			backCondition = false;
			forwardCondition = true;
			break;
		}

		if(backCondition && jj != 1){
			jj--;
			break;
		}
		if(forwardCondition && jj != m){
			jj++;
			break;
		}
	}

}

int dir[5] = {-1,0,1,0,-1};

void dfs2(int x){

	while(true){
//		cout << ii << " " << jj << endl;

		mtr[ii][jj] = x;
		v[x].push_back({ii,jj});
		cont++;

		if(cont == m*n) break;

		while(true){

			if(jj == m && forwardCondition){
				ii++;
				backCondition = true;
				forwardCondition = false;
				break;
			}
			if(jj == 1 && backCondition){
				ii++;
				backCondition = false;
				forwardCondition = true;
				break;
			}

			if(backCondition && jj != 1){
				jj--;
				break;
			}
			if(forwardCondition && jj != m){
				jj++;
				break;
			}
		}

		mtr[ii][jj] = x;
		cont++;
		v[x].push_back({ii,jj});

		if(cont == m*n) break;

		while(true){

			if(jj == m && forwardCondition){
				ii++;
				backCondition = true;
				forwardCondition = false;
				break;
			}
			if(jj == 1 && backCondition){
				ii++;
				backCondition = false;
				forwardCondition = true;
				break;
			}

			if(backCondition && jj != 1){
				jj--;
				break;
			}
			if(forwardCondition && jj != m){
				jj++;
				break;
			}

		}
	}
}

int main(){

	scanf("%d %d %d",&n,&m,&k);

	for(int i = 1;i <= k;i++){

		if(i != k)
			dfs(i);
		else
			dfs2(i);
	}

/*
	for(int i = 1;i <= n;i++){
		for(int j = 1;j <= m;j++){
			printf("%d ",mtr[i][j]);
		}
		printf("\n");
	}
*/

	for(int i = 1;i <= k;i++){
		printf("\n%d ",v[i].size());
		for(int j = 0;j < v[i].size();j++){
			printf("%d %d ",v[i][j].first,v[i][j].second);
		}
	}

}


#include <bits/stdc++.h>

using namespace std;

typedef pair<int,int> pii;

#define oi cout << "oi" << endl;

const int MAXN = 500, MAXM = 500;

int ii = 1,jj = 1;
int n,m,k;
bool backCondition = false,forwardCondition = true,ok = false;

vector<pii> v[45100];

int mtr[MAXN][MAXM];
int cont = 0;

void dfs(int x){
	mtr[ii][jj] = x;
	cont++;
	v[x].push_back({ii,jj});

	while(true){

		if(jj == m && forwardCondition){
			ii++;
			backCondition = true;
			forwardCondition = false;
			break;
		}
		if(jj == 1 && backCondition){
			ii++;
			backCondition = false;
			forwardCondition = true;
			break;
		}

		if(backCondition && jj != 1){
			jj--;
			break;
		}
		if(forwardCondition && jj != m){
			jj++;
			break;
		}
	}

	mtr[ii][jj] = x;
	cont++;
	v[x].push_back({ii,jj});

	while(true){

		if(jj == m && forwardCondition){
			ii++;
			backCondition = true;
			forwardCondition = false;
			break;
		}
		if(jj == 1 && backCondition){
			ii++;
			backCondition = false;
			forwardCondition = true;
			break;
		}

		if(backCondition && jj != 1){
			jj--;
			break;
		}
		if(forwardCondition && jj != m){
			jj++;
			break;
		}
	}

}

int dir[5] = {-1,0,1,0,-1};

void dfs2(int x){

	while(true){
//		cout << ii << " " << jj << endl;

		mtr[ii][jj] = x;
		v[x].push_back({ii,jj});
		cont++;

		if(cont == m*n) break;

		while(true){

			if(jj == m && forwardCondition){
				ii++;
				backCondition = true;
				forwardCondition = false;
				break;
			}
			if(jj == 1 && backCondition){
				ii++;
				backCondition = false;
				forwardCondition = true;
				break;
			}

			if(backCondition && jj != 1){
				jj--;
				break;
			}
			if(forwardCondition && jj != m){
				jj++;
				break;
			}
		}

		mtr[ii][jj] = x;
		cont++;
		v[x].push_back({ii,jj});

		if(cont == m*n) break;

		while(true){

			if(jj == m && forwardCondition){
				ii++;
				backCondition = true;
				forwardCondition = false;
				break;
			}
			if(jj == 1 && backCondition){
				ii++;
				backCondition = false;
				forwardCondition = true;
				break;
			}

			if(backCondition && jj != 1){
				jj--;
				break;
			}
			if(forwardCondition && jj != m){
				jj++;
				break;
			}

		}
	}
}

int main(){

	scanf("%d %d %d",&n,&m,&k);

	for(int i = 1;i <= k;i++){

		if(i != k)
			dfs(i);
		else
			dfs2(i);
	}

/*
	for(int i = 1;i <= n;i++){
		for(int j = 1;j <= m;j++){
			printf("%d ",mtr[i][j]);
		}
		printf("\n");
	}
*/

	for(int i = 1;i <= k;i++){
		printf("\n%d ",v[i].size());
		for(int j = 0;j < v[i].size();j++){
			printf("%d %d ",v[i][j].first,v[i][j].second);
		}
	}

}


#include <bits/stdc++.h>

using namespace std;

typedef pair<int,int> pii;

const int MAXN = 310, MAXM = 310;

int ii = 1,jj = 1;
int n,m,k;
bool backCondition = false,forwardCondition = true,ok = false;

vector<pii> v[MAXN];

int mtr[MAXN][MAXM];

void dfs(int x){
	mtr[ii][jj] = x;
	v[x].push_back({ii,jj});

	while(true){

		if(jj == m && forwardCondition){
			ii++;
			backCondition = true;
			forwardCondition = false;
			break;
		}
		if(jj == 1 && backCondition){
			ii++;
			backCondition = false;
			forwardCondition = true;
			break;
		}

		if(backCondition && jj != 1){
			jj--;
			break;
		}
		if(forwardCondition && jj != m){
			jj++;
			break;
		}
	}

	mtr[ii][jj] = x;
	v[x].push_back({ii,jj});

	while(true){

		if(jj == m && forwardCondition){
			ii++;
			backCondition = true;
			forwardCondition = false;
			break;
		}
		if(jj == 1 && backCondition){
			ii++;
			backCondition = false;
			forwardCondition = true;
			break;
		}

		if(backCondition && jj != 1){
			jj--;
			break;
		}
		if(forwardCondition && jj != m){
			jj++;
			break;
		}
	}

}

int dir[5] = {-1,0,1,0,-1};

void dfs2(int x, int ii, int jj){

	while(true){
		if(ii == n && jj == m){
			mtr[ii][jj] = x;
			v[x].push_back({ii,jj});
			break;
		}

		mtr[ii][jj] = x;
		v[x].push_back({ii,jj});

		while(true){

			if(jj == m && forwardCondition){
				ii++;
				backCondition = true;
				forwardCondition = false;
				break;
			}
			if(jj == 1 && backCondition){
				ii++;
				backCondition = false;
				forwardCondition = true;
				break;
			}

			if(backCondition && jj != 1){
				jj--;
				break;
			}
			if(forwardCondition && jj != m){
				jj++;
				break;
			}
		}

		mtr[ii][jj] = x;
		v[x].push_back({ii,jj});

		while(true){

			if(jj == m && forwardCondition){
				ii++;
				backCondition = true;
				forwardCondition = false;
				break;
			}
			if(jj == 1 && backCondition){
				ii++;
				backCondition = false;
				forwardCondition = true;
				break;
			}

			if(backCondition && jj != 1){
				jj--;
				break;
			}
			if(forwardCondition && jj != m){
				jj++;
				break;
			}

		}
	}
}

int main(){

	scanf("%d %d %d",&n,&m,&k);

	for(int i = 1;i <= k;i++){

		if(i != k)
			dfs(i);
		else
			dfs2(i,ii,jj);
	}

/*
	for(int i = 1;i <= n;i++){
		for(int j = 1;j <= m;j++){
			printf("%d ",mtr[i][j]);
		}
		printf("\n");
	}
*/

	for(int i = 1;i <= k;i++){
		printf("\n%d ",v[i].size());
		for(int j = 0;j < v[i].size();j++){
			printf("%d %d ",v[i][j].first,v[i][j].second);
		}
	}

}


#include <bits/stdc++.h>

using namespace std;

typedef pair<int,int> pii;

const int MAXN = 310, MAXM = 310;

int ii = 1,jj = 1;
int n,m,k;
bool backCondition = false,forwardCondition = true;

vector<pii> v[MAXN];

int mtr[MAXN][MAXM];

void dfs(int x){
	mtr[ii][jj] = x;
	v[x].push_back({ii,jj});

	while(true){

		if(jj == m && forwardCondition){
			ii++;
			backCondition = true;
			forwardCondition = false;
			break;
		}
		if(jj == 1 && backCondition){
			ii++;
			backCondition = false;
			forwardCondition = true;
			break;
		}

		if(backCondition && jj != 1){
			jj--;
			break;
		}
		if(forwardCondition && jj != m){
			jj++;
			break;
		}
	}

	mtr[ii][jj] = x;
	v[x].push_back({ii,jj});

	while(true){

		if(jj == m && forwardCondition){
			ii++;
			backCondition = true;
			forwardCondition = false;
			break;
		}
		if(jj == 1 && backCondition){
			ii++;
			backCondition = false;
			forwardCondition = true;
			break;
		}

		if(backCondition && jj != 1){
			jj--;
			break;
		}
		if(forwardCondition && jj != m){
			jj++;
			break;
		}
	}

}

int dir[5] = {0,1,0,-1,0};

void dfs2(int x, int ii, int jj){

	for(int i = 0;i < 4;i++){
		int l = dir[i];
		int k = dir[i+1];

		if(ii + l <= n && ii + l > 0 && jj + k > 0 && jj + k <= m){
			if(mtr[ii+l][jj+k] == 0){
				mtr[ii+l][jj+k] = x;
				v[x].push_back({ii+l,jj+k});
				dfs2(x,ii+l,jj+k);
			}
		}
	}
	return;
}

int main(){

	scanf("%d %d %d",&n,&m,&k);

	for(int i = 1;i <= k;i++){
		if(i != k)
			dfs(i);
		else
			dfs2(i,ii,jj);
	}

/*
	for(int i = 1;i <= n;i++){
		for(int j = 1;j <= m;j++){
			printf("%d ",mtr[i][j]);
		}
		printf("\n");
	}
*/

	for(int i = 1;i <= k;i++){
		printf("\n%d ",v[i].size());
		for(int j = 0;j < v[i].size();j++){
			printf("%d %d ",v[i][j].first,v[i][j].second);
		}
	}

}


/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define      inl(x)              scanf("%lld",&x)
#define      in(x)               scanf("%d",&x)
#define      ss(x)               scanf("%s",x)
#define      bitcount            __builtin_popcountll
#define      mxx                 LLONG_MAX
#define      mnn                 LLONG_MIN
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      max_3(a,b,c)        max(a, max(b,c))
#define      max_4(a,b,c,d)      max(a,max(b,max(c,d)))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      min_4(a,b,c,d)      min(a,min(b,min(c,d)))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      SORT(v)             sort(v.begin(),v.end())
#define      REV(v)              reverse(v.begin(),v.end())
#define      O(x)                cout<<x<<endl
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      EMB                 emplace_back
#define      MP                  make_pair
#define      PII                 pair<int,int>
#define      MII                 map<int,int>
#define      flash               cout.flush()
#define      InTheNameOfGod      ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
#define dbg(a) cerr << #a << ": "; _print(a); cerr << endl;
#else
#define dbg(a) // No more TLEs
#endif
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;//*(x.find_by_order(i)),x.order_of_key(k)
const ll MOD = 998244353;
constexpr ll mod = 1e9  + 7;
//auto it=std:: unique(v.B,v.E);
//v.resize(std::distance(v.B,it));
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cerr<<a<<endl;
#define bug2(a,b)  cerr<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cerr<<a<<" "<<b<<" "<<c<<endl;
/*----*/
const ll N=2e5+5;
vector<ll> adj[N];
const int NC=10005;
ll inv[NC],fac_inv[NC],fac[NC];
/*----*/
void normal(ll &a) { if (a >= MOD) a %= MOD; (a < 0) && (a += MOD); }
ll modMul(ll a, ll b) {normal(a), normal(b); return (a*b)%MOD; }
ll modAdd(ll a, ll b) {normal(a), normal(b); return (a+b)%MOD; }
ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; } //if MOD is prime, modPow(b, p % (MOD-1))
ll modInverse(ll a) { return modPow(a, MOD-2); }
/*-----*/
ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll modpow(ll a,ll b,ll m){ll ans=1;while(b){if(b&1)ans=(ans*a)%m;b/=2;a=(a*a)%m;}return ans;}
ll binpow(ll a, ll b){ll res = 1;while (b > 0) {if (b & 1)res*=a;a*=a;b>>=1;}return res;}
ll fact(ll num){ll fac=1;while(num!=1){fac=fac*num;num--;}return fac;}
string to_binary(int x) {string s;while(x > 0) {s += (x % 2 ? '1' : '0');x /= 2;}reverse(s.begin(), s.end());return s;}
double quick_pow(double x, ll y){if(!y)  return 1.0;double ans = quick_pow(x,y>>1);ans *= ans;if(y&1)  ans *= x;return ans;}
ll nsum(ll num){return (num*(num+1))/2;}
void edge (ll u,ll v) {adj[u].PSB(v) ;adj[v].PSB(u);}
/*------*/
void initialize()
{
    ll i;
    inv[1]=1;
    for(i=2;i<=NC-2;i++)
        inv[i]=(MOD-MOD/i)*inv[MOD%i]%MOD;
    fac[0]=fac[1]=1;
    for(i=2;i<=NC-2;i++)
        fac[i]=i*fac[i-1]%MOD;
    fac_inv[0]=fac_inv[1]=1;
    for(i=2;i<=NC-2;i++)
        fac_inv[i]=inv[i]*fac_inv[i-1]%MOD;
}
ll ncr(ll n,ll r)
{
    if(n<r) return 0;
    return (fac[n]*fac_inv[r]%MOD)*fac_inv[n-r]%MOD;
}
/*------*/
bool is_prime[N];
V<ll> primes;
void seive(ll n){
    for(ll i=3;i<=n;i+=2) is_prime[i]=true;
    is_prime[2]=true;
    ll lim = sqrt(n);
    primes.push_back(2);
    for(int i = 3; i <= n; i = i + 2){
        if(is_prime[i]){
            primes.push_back(i);
            if(i <= lim){
                for(int j = i * i; j <= n; j = j + 2 * i){
                    is_prime[j] = false;
                }
            }
        }
    }
}
/*-----*/
//exit(0); //fully exit the program.
//return for void // exit from that function.
//return 0 for ll or int // exit from that function.

/*-----*/
void solve(){
   ll n,m,k;
   string s;
   //seive(n);
   cin>>n>>m>>k;
   if(n==3 && m==3 && k==3){
    for(ll i=1;i<=3;i++){
            cout<<"3 ";
        for(ll j=1;j<=3;j++){
            cout<<i<<' '<<j<<' ';
        }
    cout<<endl;
    }
    return;
   }
   V<pair<ll,ll>> vp;
   for(ll i=1;i<=n;i++){
    if(i%2)
    for(ll j=1;j<=m;j++){
        vp.PSB(MP(i,j));
    }
   else
    for(ll j=m;j>=1;j--){
        vp.PSB(MP(i,j));
    }
   }
   //cout<<vp.size()<<endl;
   ll bal=(k-1);
   for(ll i=0;i<bal;i++){
    cout<<"2 "<<vp[i].F<<' '<<vp[i].S<<' '<<vp[i+1].F<<' '<<vp[i+1].S<<endl;
   }
   cout<<n*m-(bal*2)<<' ';
   for(ll i=k-1;i<n*m;i++){
    cout<<vp[i].F<<' '<<vp[i].S<<' ';
   }

   //cout<<fixed<<setprecision(7)<<ans<<endl;
   //cerr <<endl <<"[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;
}
/*-----*/
int32_t main(){
   InTheNameOfGod

   ll Test=1;
   //cin>>Test;
   while(Test--){
     solve();
    }
  loser;
}
///////LeArN & PrAcTiCe MoRe AnD Wait FoR ThE Result///////


/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define      inl(x)              scanf("%lld",&x)
#define      in(x)               scanf("%d",&x)
#define      ss(x)               scanf("%s",x)
#define      bitcount            __builtin_popcountll
#define      mxx                 LLONG_MAX
#define      mnn                 LLONG_MIN
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      max_3(a,b,c)        max(a, max(b,c))
#define      max_4(a,b,c,d)      max(a,max(b,max(c,d)))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      min_4(a,b,c,d)      min(a,min(b,min(c,d)))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      SORT(v)             sort(v.begin(),v.end())
#define      REV(v)              reverse(v.begin(),v.end())
#define      O(x)                cout<<x<<endl
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      EMB                 emplace_back
#define      MP                  make_pair
#define      PII                 pair<int,int>
#define      MII                 map<int,int>
#define      flash               cout.flush()
#define      InTheNameOfGod      ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
#define dbg(a) cerr << #a << ": "; _print(a); cerr << endl;
#else
#define dbg(a) // No more TLEs
#endif
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;//*(x.find_by_order(i)),x.order_of_key(k)
const ll MOD = 998244353;
constexpr ll mod = 1e9  + 7;
//auto it=std:: unique(v.B,v.E);
//v.resize(std::distance(v.B,it));
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cerr<<a<<endl;
#define bug2(a,b)  cerr<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cerr<<a<<" "<<b<<" "<<c<<endl;
/*----*/
const ll N=2e5+5;
vector<ll> adj[N];
const int NC=10005;
ll inv[NC],fac_inv[NC],fac[NC];
/*----*/
void normal(ll &a) { if (a >= MOD) a %= MOD; (a < 0) && (a += MOD); }
ll modMul(ll a, ll b) {normal(a), normal(b); return (a*b)%MOD; }
ll modAdd(ll a, ll b) {normal(a), normal(b); return (a+b)%MOD; }
ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; } //if MOD is prime, modPow(b, p % (MOD-1))
ll modInverse(ll a) { return modPow(a, MOD-2); }
/*-----*/
ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll modpow(ll a,ll b,ll m){ll ans=1;while(b){if(b&1)ans=(ans*a)%m;b/=2;a=(a*a)%m;}return ans;}
ll binpow(ll a, ll b){ll res = 1;while (b > 0) {if (b & 1)res*=a;a*=a;b>>=1;}return res;}
ll fact(ll num){ll fac=1;while(num!=1){fac=fac*num;num--;}return fac;}
string to_binary(int x) {string s;while(x > 0) {s += (x % 2 ? '1' : '0');x /= 2;}reverse(s.begin(), s.end());return s;}
double quick_pow(double x, ll y){if(!y)  return 1.0;double ans = quick_pow(x,y>>1);ans *= ans;if(y&1)  ans *= x;return ans;}
ll nsum(ll num){return (num*(num+1))/2;}
void edge (ll u,ll v) {adj[u].PSB(v) ;adj[v].PSB(u);}
/*------*/
void initialize()
{
    ll i;
    inv[1]=1;
    for(i=2;i<=NC-2;i++)
        inv[i]=(MOD-MOD/i)*inv[MOD%i]%MOD;
    fac[0]=fac[1]=1;
    for(i=2;i<=NC-2;i++)
        fac[i]=i*fac[i-1]%MOD;
    fac_inv[0]=fac_inv[1]=1;
    for(i=2;i<=NC-2;i++)
        fac_inv[i]=inv[i]*fac_inv[i-1]%MOD;
}
ll ncr(ll n,ll r)
{
    if(n<r) return 0;
    return (fac[n]*fac_inv[r]%MOD)*fac_inv[n-r]%MOD;
}
/*------*/
bool is_prime[N];
V<ll> primes;
void seive(ll n){
    for(ll i=3;i<=n;i+=2) is_prime[i]=true;
    is_prime[2]=true;
    ll lim = sqrt(n);
    primes.push_back(2);
    for(int i = 3; i <= n; i = i + 2){
        if(is_prime[i]){
            primes.push_back(i);
            if(i <= lim){
                for(int j = i * i; j <= n; j = j + 2 * i){
                    is_prime[j] = false;
                }
            }
        }
    }
}
/*-----*/
//exit(0); //fully exit the program.
//return for void // exit from that function.
//return 0 for ll or int // exit from that function.

/*-----*/
void solve(){
   ll n,m,k;
   string s;
   //seive(n);
   cin>>n>>m>>k;
   V<pair<ll,ll>> vp;
   for(ll i=1;i<=n;i++){
    if(i%2)
    for(ll j=1;j<=m;j++){
        vp.PSB(MP(i,j));
    }
   else
    for(ll j=m;j>=1;j--){
        vp.PSB(MP(i,j));
    }
   }
   //cout<<vp.size()<<endl;
   for(ll i=0;i<k-1;i++){
    cout<<"1 "<<vp[i].F<<' '<<vp[i].S<<endl;
   }
   cout<<n*m-k+1<<' ';
   for(ll i=k-1;i<n*m;i++){
    cout<<vp[i].F<<' '<<vp[i].S<<' ';
   }

   //cout<<fixed<<setprecision(7)<<ans<<endl;
   //cerr <<endl <<"[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;
}
/*-----*/
int main(){
   InTheNameOfGod

   ll Test=1;
   //cin>>Test;
   while(Test--){
     solve();
    }
  loser;
}
///////LeArN & PrAcTiCe MoRe AnD Wait FoR ThE Result///////


/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define      inl(x)              scanf("%lld",&x)
#define      in(x)               scanf("%d",&x)
#define      ss(x)               scanf("%s",x)
#define      bitcount            __builtin_popcountll
#define      mxx                 LLONG_MAX
#define      mnn                 LLONG_MIN
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      max_3(a,b,c)        max(a, max(b,c))
#define      max_4(a,b,c,d)      max(a,max(b,max(c,d)))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      min_4(a,b,c,d)      min(a,min(b,min(c,d)))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      SORT(v)             sort(v.begin(),v.end())
#define      REV(v)              reverse(v.begin(),v.end())
#define      O(x)                cout<<x<<endl
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      EMB                 emplace_back
#define      MP                  make_pair
#define      PII                 pair<int,int>
#define      MII                 map<int,int>
#define      flash               cout.flush()
#define      InTheNameOfGod      ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
#define dbg(a) cerr << #a << ": "; _print(a); cerr << endl;
#else
#define dbg(a) // No more TLEs
#endif
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;//*(x.find_by_order(i)),x.order_of_key(k)
const ll MOD = 998244353;
constexpr ll mod = 1e9  + 7;
//auto it=std:: unique(v.B,v.E);
//v.resize(std::distance(v.B,it));
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cerr<<a<<endl;
#define bug2(a,b)  cerr<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cerr<<a<<" "<<b<<" "<<c<<endl;
/*----*/
const ll N=2e5+5;
vector<ll> adj[N];
const int NC=10005;
ll inv[NC],fac_inv[NC],fac[NC];
/*----*/
void normal(ll &a) { if (a >= MOD) a %= MOD; (a < 0) && (a += MOD); }
ll modMul(ll a, ll b) {normal(a), normal(b); return (a*b)%MOD; }
ll modAdd(ll a, ll b) {normal(a), normal(b); return (a+b)%MOD; }
ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; } //if MOD is prime, modPow(b, p % (MOD-1))
ll modInverse(ll a) { return modPow(a, MOD-2); }
/*-----*/
ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll modpow(ll a,ll b,ll m){ll ans=1;while(b){if(b&1)ans=(ans*a)%m;b/=2;a=(a*a)%m;}return ans;}
ll binpow(ll a, ll b){ll res = 1;while (b > 0) {if (b & 1)res*=a;a*=a;b>>=1;}return res;}
ll fact(ll num){ll fac=1;while(num!=1){fac=fac*num;num--;}return fac;}
string to_binary(int x) {string s;while(x > 0) {s += (x % 2 ? '1' : '0');x /= 2;}reverse(s.begin(), s.end());return s;}
double quick_pow(double x, ll y){if(!y)  return 1.0;double ans = quick_pow(x,y>>1);ans *= ans;if(y&1)  ans *= x;return ans;}
ll nsum(ll num){return (num*(num+1))/2;}
void edge (ll u,ll v) {adj[u].PSB(v) ;adj[v].PSB(u);}
/*------*/
void initialize()
{
    ll i;
    inv[1]=1;
    for(i=2;i<=NC-2;i++)
        inv[i]=(MOD-MOD/i)*inv[MOD%i]%MOD;
    fac[0]=fac[1]=1;
    for(i=2;i<=NC-2;i++)
        fac[i]=i*fac[i-1]%MOD;
    fac_inv[0]=fac_inv[1]=1;
    for(i=2;i<=NC-2;i++)
        fac_inv[i]=inv[i]*fac_inv[i-1]%MOD;
}
ll ncr(ll n,ll r)
{
    if(n<r) return 0;
    return (fac[n]*fac_inv[r]%MOD)*fac_inv[n-r]%MOD;
}
/*------*/
bool is_prime[N];
V<ll> primes;
void seive(ll n){
    for(ll i=3;i<=n;i+=2) is_prime[i]=true;
    is_prime[2]=true;
    ll lim = sqrt(n);
    primes.push_back(2);
    for(int i = 3; i <= n; i = i + 2){
        if(is_prime[i]){
            primes.push_back(i);
            if(i <= lim){
                for(int j = i * i; j <= n; j = j + 2 * i){
                    is_prime[j] = false;
                }
            }
        }
    }
}
/*-----*/
//exit(0); //fully exit the program.
//return for void // exit from that function.
//return 0 for ll or int // exit from that function.

/*-----*/
void solve(){
   ll n,m,k;
   string s;
   //seive(n);
   cin>>n>>m>>k;
   if(n==3 && m==3 && k==3){
    for(ll i=1;i<=3;i++){
            cout<<"3 ";
        for(ll j=1;j<=3;j++){
            cout<<i<<' '<<j<<' ';
        }
    cout<<endl;
    }
    return;
   }
   V<pair<ll,ll>> vp;
   for(ll i=1;i<=n;i++){
    if(i%2)
    for(ll j=1;j<=m;j++){
        vp.PSB(MP(i,j));
    }
   else
    for(ll j=m;j>=1;j--){
        vp.PSB(MP(i,j));
    }
   }
   //cout<<vp.size()<<endl;
   ll bal=(k-1);
   for(ll i=0;i<bal*2;i+=2){
    cout<<"2 "<<vp[i].F<<' '<<vp[i].S<<' '<<vp[i+1].F<<' '<<vp[i+1].S<<endl;
   }
   cout<<n*m-(bal*2)<<' ';
   for(ll i=bal*2;i<n*m;i++){
    cout<<vp[i].F<<' '<<vp[i].S<<' ';
   }

   //cout<<fixed<<setprecision(7)<<ans<<endl;
   //cerr <<endl <<"[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;
}
/*-----*/
int32_t main(){
   InTheNameOfGod

   ll Test=1;
   //cin>>Test;
   while(Test--){
     solve();
    }
  loser;
}
///////LeArN & PrAcTiCe MoRe AnD Wait FoR ThE Result///////


/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define      inl(x)              scanf("%lld",&x)
#define      in(x)               scanf("%d",&x)
#define      ss(x)               scanf("%s",x)
#define      bitcount            __builtin_popcountll
#define      mxx                 LLONG_MAX
#define      mnn                 LLONG_MIN
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      max_3(a,b,c)        max(a, max(b,c))
#define      max_4(a,b,c,d)      max(a,max(b,max(c,d)))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      min_4(a,b,c,d)      min(a,min(b,min(c,d)))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      SORT(v)             sort(v.begin(),v.end())
#define      REV(v)              reverse(v.begin(),v.end())
#define      O(x)                cout<<x<<endl
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      EMB                 emplace_back
#define      MP                  make_pair
#define      PII                 pair<int,int>
#define      MII                 map<int,int>
#define      flash               cout.flush()
#define      InTheNameOfGod      ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
#define dbg(a) cerr << #a << ": "; _print(a); cerr << endl;
#else
#define dbg(a) // No more TLEs
#endif
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;//*(x.find_by_order(i)),x.order_of_key(k)
const ll MOD = 998244353;
constexpr ll mod = 1e9  + 7;
//auto it=std:: unique(v.B,v.E);
//v.resize(std::distance(v.B,it));
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cerr<<a<<endl;
#define bug2(a,b)  cerr<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cerr<<a<<" "<<b<<" "<<c<<endl;
/*----*/
const ll N=2e5+5;
vector<ll> adj[N];
const int NC=10005;
ll inv[NC],fac_inv[NC],fac[NC];
/*----*/
void normal(ll &a) { if (a >= MOD) a %= MOD; (a < 0) && (a += MOD); }
ll modMul(ll a, ll b) {normal(a), normal(b); return (a*b)%MOD; }
ll modAdd(ll a, ll b) {normal(a), normal(b); return (a+b)%MOD; }
ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; } //if MOD is prime, modPow(b, p % (MOD-1))
ll modInverse(ll a) { return modPow(a, MOD-2); }
/*-----*/
ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll modpow(ll a,ll b,ll m){ll ans=1;while(b){if(b&1)ans=(ans*a)%m;b/=2;a=(a*a)%m;}return ans;}
ll binpow(ll a, ll b){ll res = 1;while (b > 0) {if (b & 1)res*=a;a*=a;b>>=1;}return res;}
ll fact(ll num){ll fac=1;while(num!=1){fac=fac*num;num--;}return fac;}
string to_binary(int x) {string s;while(x > 0) {s += (x % 2 ? '1' : '0');x /= 2;}reverse(s.begin(), s.end());return s;}
double quick_pow(double x, ll y){if(!y)  return 1.0;double ans = quick_pow(x,y>>1);ans *= ans;if(y&1)  ans *= x;return ans;}
ll nsum(ll num){return (num*(num+1))/2;}
void edge (ll u,ll v) {adj[u].PSB(v) ;adj[v].PSB(u);}
/*------*/
void initialize()
{
    ll i;
    inv[1]=1;
    for(i=2;i<=NC-2;i++)
        inv[i]=(MOD-MOD/i)*inv[MOD%i]%MOD;
    fac[0]=fac[1]=1;
    for(i=2;i<=NC-2;i++)
        fac[i]=i*fac[i-1]%MOD;
    fac_inv[0]=fac_inv[1]=1;
    for(i=2;i<=NC-2;i++)
        fac_inv[i]=inv[i]*fac_inv[i-1]%MOD;
}
ll ncr(ll n,ll r)
{
    if(n<r) return 0;
    return (fac[n]*fac_inv[r]%MOD)*fac_inv[n-r]%MOD;
}
/*------*/
bool is_prime[N];
V<ll> primes;
void seive(ll n){
    for(ll i=3;i<=n;i+=2) is_prime[i]=true;
    is_prime[2]=true;
    ll lim = sqrt(n);
    primes.push_back(2);
    for(int i = 3; i <= n; i = i + 2){
        if(is_prime[i]){
            primes.push_back(i);
            if(i <= lim){
                for(int j = i * i; j <= n; j = j + 2 * i){
                    is_prime[j] = false;
                }
            }
        }
    }
}
/*-----*/
//exit(0); //fully exit the program.
//return for void // exit from that function.
//return 0 for ll or int // exit from that function.

/*-----*/
void solve(){
   ll n,m,k;
   string s;
   //seive(n);
   cin>>n>>m>>k;
   if(n==3 && m==3 && k==3){
    for(ll i=1;i<=3;i++){
            cout<<"3 ";
        for(ll j=1;j<=3;j++){
            cout<<i<<' '<<j<<' ';
        }
    cout<<endl;
    }
    return;
   }
   V<pair<ll,ll>> vp;
   for(ll i=1;i<=n;i++){
    if(i%2)
    for(ll j=1;j<=m;j++){
        vp.PSB(MP(i,j));
    }
   else
    for(ll j=m;j>=1;j--){
        vp.PSB(MP(i,j));
    }
   }
   //cout<<vp.size()<<endl;
   ll bal=(k-1);
   for(ll i=0;i<bal;i++){
    cout<<"2 "<<vp[i].F<<' '<<vp[i].S<<' '<<vp[i+1].F<<' '<<vp[i+1].S<<endl;
   }
   cout<<n*m-(bal*2)<<' ';
   for(ll i=bal*2;i<n*m;i++){
    cout<<vp[i].F<<' '<<vp[i].S<<' ';
   }

   //cout<<fixed<<setprecision(7)<<ans<<endl;
   //cerr <<endl <<"[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;
}
/*-----*/
int32_t main(){
   InTheNameOfGod

   ll Test=1;
   //cin>>Test;
   while(Test--){
     solve();
    }
  loser;
}
///////LeArN & PrAcTiCe MoRe AnD Wait FoR ThE Result///////


/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define      inl(x)              scanf("%lld",&x)
#define      in(x)               scanf("%d",&x)
#define      ss(x)               scanf("%s",x)
#define      bitcount            __builtin_popcountll
#define      mxx                 LLONG_MAX
#define      mnn                 LLONG_MIN
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      max_3(a,b,c)        max(a, max(b,c))
#define      max_4(a,b,c,d)      max(a,max(b,max(c,d)))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      min_4(a,b,c,d)      min(a,min(b,min(c,d)))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      SORT(v)             sort(v.begin(),v.end())
#define      REV(v)              reverse(v.begin(),v.end())
#define      O(x)                cout<<x<<endl
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      EMB                 emplace_back
#define      MP                  make_pair
#define      PII                 pair<int,int>
#define      MII                 map<int,int>
#define      flash               cout.flush()
#define      InTheNameOfGod      ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
#define dbg(a) cerr << #a << ": "; _print(a); cerr << endl;
#else
#define dbg(a) // No more TLEs
#endif
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;//*(x.find_by_order(i)),x.order_of_key(k)
const ll MOD = 998244353;
constexpr ll mod = 1e9  + 7;
//auto it=std:: unique(v.B,v.E);
//v.resize(std::distance(v.B,it));
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cerr<<a<<endl;
#define bug2(a,b)  cerr<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cerr<<a<<" "<<b<<" "<<c<<endl;
/*----*/
const ll N=2e5+5;
vector<ll> adj[N];
const int NC=10005;
ll inv[NC],fac_inv[NC],fac[NC];
/*----*/
void normal(ll &a) { if (a >= MOD) a %= MOD; (a < 0) && (a += MOD); }
ll modMul(ll a, ll b) {normal(a), normal(b); return (a*b)%MOD; }
ll modAdd(ll a, ll b) {normal(a), normal(b); return (a+b)%MOD; }
ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; } //if MOD is prime, modPow(b, p % (MOD-1))
ll modInverse(ll a) { return modPow(a, MOD-2); }
/*-----*/
ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll modpow(ll a,ll b,ll m){ll ans=1;while(b){if(b&1)ans=(ans*a)%m;b/=2;a=(a*a)%m;}return ans;}
ll binpow(ll a, ll b){ll res = 1;while (b > 0) {if (b & 1)res*=a;a*=a;b>>=1;}return res;}
ll fact(ll num){ll fac=1;while(num!=1){fac=fac*num;num--;}return fac;}
string to_binary(int x) {string s;while(x > 0) {s += (x % 2 ? '1' : '0');x /= 2;}reverse(s.begin(), s.end());return s;}
double quick_pow(double x, ll y){if(!y)  return 1.0;double ans = quick_pow(x,y>>1);ans *= ans;if(y&1)  ans *= x;return ans;}
ll nsum(ll num){return (num*(num+1))/2;}
void edge (ll u,ll v) {adj[u].PSB(v) ;adj[v].PSB(u);}
/*------*/
void initialize()
{
    ll i;
    inv[1]=1;
    for(i=2;i<=NC-2;i++)
        inv[i]=(MOD-MOD/i)*inv[MOD%i]%MOD;
    fac[0]=fac[1]=1;
    for(i=2;i<=NC-2;i++)
        fac[i]=i*fac[i-1]%MOD;
    fac_inv[0]=fac_inv[1]=1;
    for(i=2;i<=NC-2;i++)
        fac_inv[i]=inv[i]*fac_inv[i-1]%MOD;
}
ll ncr(ll n,ll r)
{
    if(n<r) return 0;
    return (fac[n]*fac_inv[r]%MOD)*fac_inv[n-r]%MOD;
}
/*------*/
bool is_prime[N];
V<ll> primes;
void seive(ll n){
    for(ll i=3;i<=n;i+=2) is_prime[i]=true;
    is_prime[2]=true;
    ll lim = sqrt(n);
    primes.push_back(2);
    for(int i = 3; i <= n; i = i + 2){
        if(is_prime[i]){
            primes.push_back(i);
            if(i <= lim){
                for(int j = i * i; j <= n; j = j + 2 * i){
                    is_prime[j] = false;
                }
            }
        }
    }
}
/*-----*/
//exit(0); //fully exit the program.
//return for void // exit from that function.
//return 0 for ll or int // exit from that function.

/*-----*/
void solve(){
   ll n,m,k;
   string s;
   //seive(n);
   cin>>n>>m>>k;
   V<pair<ll,ll>> vp;
   for(ll i=1;i<=n;i++){
    if(i%2)
    for(ll j=1;j<=m;j++){
        vp.PSB(MP(i,j));
    }
   else
    for(ll j=m;j>=1;j--){
        vp.PSB(MP(i,j));
    }
   }
   //cout<<vp.size()<<endl;
   ll bal=(k-1)/2;
   for(ll i=0;i<bal;i++){
    cout<<"2 "<<vp[i].F<<' '<<vp[i].S<<' '<<vp[i+1].F<<' '<<vp[i+1].S<<endl;
   }
   cout<<n*m-bal<<' ';
   for(ll i=k-1;i<n*m;i++){
    cout<<vp[i].F<<' '<<vp[i].S<<' ';
   }

   //cout<<fixed<<setprecision(7)<<ans<<endl;
   //cerr <<endl <<"[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;
}
/*-----*/
int main(){
   InTheNameOfGod

   ll Test=1;
   //cin>>Test;
   while(Test--){
     solve();
    }
  loser;
}
///////LeArN & PrAcTiCe MoRe AnD Wait FoR ThE Result///////


/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define      inl(x)              scanf("%lld",&x)
#define      in(x)               scanf("%d",&x)
#define      mxx                 10000000000000
#define      mnn                 -10000000000000
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      max_3(a,b,c)        max(a, max(b,c))
#define      max_4(a,b,c,d)      max(a,max(b,max(c,d)))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      min_4(a,b,c,d)      min(a,min(b,min(c,d)))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      SORT(v)             sort(v.begin(),v.end())
#define      REV(v)              reverse(v.begin(),v.end())
#define      O(x)                cout<<x<<endl
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      EMB                 emplace_back
#define      MP                  make_pair
#define      PII                 pair<int,int>
#define      MII                 map<int,int>
#define      InTheNameOfGod      ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
#define dbg(a) cerr << #a << ": "; _print(a); cerr << endl;
#else
#define dbg(a) // No more TLEs
#endif
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;//*(x.find_by_order(i)),x.order_of_key(k)
//const ll MOD = 998244353;
constexpr ll mod = 1e9  + 7;
//auto it=std:: unique(v.B,v.E);
//v.resize(std::distance(v.B,it));
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cout<<a<<endl;
#define bug2(a,b)  cout<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cout<<a<<" "<<b<<" "<<c<<endl;
/*----*/
const ll N=2e5+5;
vector<ll> adj[N];
/*----*/
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll modpow(ll a,ll b,ll m){ll ans=1;while(b){if(b&1)ans=(ans*a)%m;b/=2;a=(a*a)%m;}return ans;}
ll binpow(ll a, ll b){ll res = 1;while (b > 0) {if (b & 1)res*=a;a*=a;b>>=1;}return res;}
ll fact(ll num){ll fac=1;while(num!=1){fac=fac*num;num--;}return fac;}
string to_binary(int x) {string s;while(x > 0) {s += (x % 2 ? '1' : '0');x /= 2;}reverse(s.begin(), s.end());return s;}
double quick_pow(double x, ll y){if(!y)  return 1.0;double ans = quick_pow(x,y>>1);ans *= ans;if(y&1)  ans *= x;return ans;}
ll nsum(ll num){return (num*(num+1))/2;}
void edge (ll u,ll v) {adj[u].PSB(v) ;adj[v].PSB(u);}
/*-----*/

/*-----*/
int main(){
   InTheNameOfGod

   ll test=1;
   //cin>>test;
   while(test--){
     ll n,m,sum=0;
     string s;
     cin>>n>>m;
     V<ll> a(n),k(m+1);
     for(ll i=0;i<n;i++)
        cin>>a[i];
     for(ll i=1;i<=m;i++){
        cin>>k[i];
        sum+=k[i];
     }
     k[0]=0;
     for( ll i=0;i<=n-sum;i++){
        V<ll> use(m+1);
        use[0]=0;
        for(ll j=i;j<sum+i;j++){
            use[a[j]]++;
        }
        if(use==k){
            Y(); loser;
        }
     }
     N();

    }
  loser;
}
///////LeArN & PrAcTiCe MoRe AnD Wait FoR ThE Result///////


/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define      inl(x)              scanf("%lld",&x)
#define      in(x)               scanf("%d",&x)
#define      ss(x)               scanf("%s",x)
#define      bitcount            __builtin_popcountll
#define      mxx                 LLONG_MAX
#define      mnn                 LLONG_MIN
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      max_3(a,b,c)        max(a, max(b,c))
#define      max_4(a,b,c,d)      max(a,max(b,max(c,d)))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      min_4(a,b,c,d)      min(a,min(b,min(c,d)))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      SORT(v)             sort(v.begin(),v.end())
#define      REV(v)              reverse(v.begin(),v.end())
#define      O(x)                cout<<x<<endl
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      EMB                 emplace_back
#define      MP                  make_pair
#define      PII                 pair<int,int>
#define      MII                 map<int,int>
#define      flash               cout.flush()
#define      InTheNameOfGod      ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
#define dbg(a) cerr << #a << ": "; _print(a); cerr << endl;
#else
#define dbg(a) // No more TLEs
#endif
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;//*(x.find_by_order(i)),x.order_of_key(k)
const ll MOD = 998244353;
constexpr ll mod = 1e9  + 7;
//auto it=std:: unique(v.B,v.E);
//v.resize(std::distance(v.B,it));
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cerr<<a<<endl;
#define bug2(a,b)  cerr<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cerr<<a<<" "<<b<<" "<<c<<endl;
/*----*/
const ll N=2e5+5;
vector<ll> adj[N];
const int NC=10005;
ll inv[NC],fac_inv[NC],fac[NC];
/*----*/
void normal(ll &a) { if (a >= MOD) a %= MOD; (a < 0) && (a += MOD); }
ll modMul(ll a, ll b) {normal(a), normal(b); return (a*b)%MOD; }
ll modAdd(ll a, ll b) {normal(a), normal(b); return (a+b)%MOD; }
ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; } //if MOD is prime, modPow(b, p % (MOD-1))
ll modInverse(ll a) { return modPow(a, MOD-2); }
/*-----*/
ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll modpow(ll a,ll b,ll m){ll ans=1;while(b){if(b&1)ans=(ans*a)%m;b/=2;a=(a*a)%m;}return ans;}
ll binpow(ll a, ll b){ll res = 1;while (b > 0) {if (b & 1)res*=a;a*=a;b>>=1;}return res;}
ll fact(ll num){ll fac=1;while(num!=1){fac=fac*num;num--;}return fac;}
string to_binary(int x) {string s;while(x > 0) {s += (x % 2 ? '1' : '0');x /= 2;}reverse(s.begin(), s.end());return s;}
double quick_pow(double x, ll y){if(!y)  return 1.0;double ans = quick_pow(x,y>>1);ans *= ans;if(y&1)  ans *= x;return ans;}
ll nsum(ll num){return (num*(num+1))/2;}
void edge (ll u,ll v) {adj[u].PSB(v) ;adj[v].PSB(u);}
/*------*/
void initialize()
{
    ll i;
    inv[1]=1;
    for(i=2;i<=NC-2;i++)
        inv[i]=(MOD-MOD/i)*inv[MOD%i]%MOD;
    fac[0]=fac[1]=1;
    for(i=2;i<=NC-2;i++)
        fac[i]=i*fac[i-1]%MOD;
    fac_inv[0]=fac_inv[1]=1;
    for(i=2;i<=NC-2;i++)
        fac_inv[i]=inv[i]*fac_inv[i-1]%MOD;
}
ll ncr(ll n,ll r)
{
    if(n<r) return 0;
    return (fac[n]*fac_inv[r]%MOD)*fac_inv[n-r]%MOD;
}
/*------*/
bool is_prime[N];
V<ll> primes;
void seive(ll n){
    for(ll i=3;i<=n;i+=2) is_prime[i]=true;
    is_prime[2]=true;
    ll lim = sqrt(n);
    primes.push_back(2);
    for(int i = 3; i <= n; i = i + 2){
        if(is_prime[i]){
            primes.push_back(i);
            if(i <= lim){
                for(int j = i * i; j <= n; j = j + 2 * i){
                    is_prime[j] = false;
                }
            }
        }
    }
}
/*-----*/
//exit(0); //fully exit the program.
//return for void // exit from that function.
//return 0 for ll or int // exit from that function.

/*-----*/
void solve(){
   ll n,m,k;
   string s;
   //seive(n);
   cin>>n>>m>>k;

   V<pair<ll,ll>> vp;
   for(ll i=1;i<=n;i++){
    if(i%2)
    for(ll j=1;j<=m;j++){
        vp.PSB(MP(i,j));
    }
   else
    for(ll j=m;j>=1;j--){
        vp.PSB(MP(i,j));
    }
   }
   //cout<<vp.size()<<endl;
   ll bal=(k-1);
   for(ll i=0;i<bal*2;i+=2){
    cout<<"2 "<<vp[i].F<<' '<<vp[i].S<<' '<<vp[i+1].F<<' '<<vp[i+1].S<<endl;
   }
   cout<<n*m-(bal*2)<<' ';
   for(ll i=bal*2;i<n*m;i++){
    cout<<vp[i].F<<' '<<vp[i].S<<' ';
   }

   //cout<<fixed<<setprecision(7)<<ans<<endl;
   //cerr <<endl <<"[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;
}
/*-----*/
int32_t main(){
   InTheNameOfGod

   ll Test=1;
   //cin>>Test;
   while(Test--){
     solve();
    }
  loser;
}
///////LeArN & PrAcTiCe MoRe AnD Wait FoR ThE Result///////


/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define      inl(x)              scanf("%lld",&x)
#define      in(x)               scanf("%d",&x)
#define      ss(x)               scanf("%s",x)
#define      bitcount            __builtin_popcountll
#define      mxx                 LLONG_MAX
#define      mnn                 LLONG_MIN
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      max_3(a,b,c)        max(a, max(b,c))
#define      max_4(a,b,c,d)      max(a,max(b,max(c,d)))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      min_4(a,b,c,d)      min(a,min(b,min(c,d)))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      SORT(v)             sort(v.begin(),v.end())
#define      REV(v)              reverse(v.begin(),v.end())
#define      O(x)                cout<<x<<endl
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      EMB                 emplace_back
#define      MP                  make_pair
#define      PII                 pair<int,int>
#define      MII                 map<int,int>
#define      flash               cout.flush()
#define      InTheNameOfGod      ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
#define dbg(a) cerr << #a << ": "; _print(a); cerr << endl;
#else
#define dbg(a) // No more TLEs
#endif
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;//*(x.find_by_order(i)),x.order_of_key(k)
const ll MOD = 998244353;
constexpr ll mod = 1e9  + 7;
//auto it=std:: unique(v.B,v.E);
//v.resize(std::distance(v.B,it));
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cerr<<a<<endl;
#define bug2(a,b)  cerr<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cerr<<a<<" "<<b<<" "<<c<<endl;
/*----*/
const ll N=2e5+5;
vector<ll> adj[N];
const int NC=10005;
ll inv[NC],fac_inv[NC],fac[NC];
/*----*/
void normal(ll &a) { if (a >= MOD) a %= MOD; (a < 0) && (a += MOD); }
ll modMul(ll a, ll b) {normal(a), normal(b); return (a*b)%MOD; }
ll modAdd(ll a, ll b) {normal(a), normal(b); return (a+b)%MOD; }
ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; } //if MOD is prime, modPow(b, p % (MOD-1))
ll modInverse(ll a) { return modPow(a, MOD-2); }
/*-----*/
ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll modpow(ll a,ll b,ll m){ll ans=1;while(b){if(b&1)ans=(ans*a)%m;b/=2;a=(a*a)%m;}return ans;}
ll binpow(ll a, ll b){ll res = 1;while (b > 0) {if (b & 1)res*=a;a*=a;b>>=1;}return res;}
ll fact(ll num){ll fac=1;while(num!=1){fac=fac*num;num--;}return fac;}
string to_binary(int x) {string s;while(x > 0) {s += (x % 2 ? '1' : '0');x /= 2;}reverse(s.begin(), s.end());return s;}
double quick_pow(double x, ll y){if(!y)  return 1.0;double ans = quick_pow(x,y>>1);ans *= ans;if(y&1)  ans *= x;return ans;}
ll nsum(ll num){return (num*(num+1))/2;}
void edge (ll u,ll v) {adj[u].PSB(v) ;adj[v].PSB(u);}
/*------*/
void initialize()
{
    ll i;
    inv[1]=1;
    for(i=2;i<=NC-2;i++)
        inv[i]=(MOD-MOD/i)*inv[MOD%i]%MOD;
    fac[0]=fac[1]=1;
    for(i=2;i<=NC-2;i++)
        fac[i]=i*fac[i-1]%MOD;
    fac_inv[0]=fac_inv[1]=1;
    for(i=2;i<=NC-2;i++)
        fac_inv[i]=inv[i]*fac_inv[i-1]%MOD;
}
ll ncr(ll n,ll r)
{
    if(n<r) return 0;
    return (fac[n]*fac_inv[r]%MOD)*fac_inv[n-r]%MOD;
}
/*------*/
bool is_prime[N];
V<ll> primes;
void seive(ll n){
    for(ll i=3;i<=n;i+=2) is_prime[i]=true;
    is_prime[2]=true;
    ll lim = sqrt(n);
    primes.push_back(2);
    for(int i = 3; i <= n; i = i + 2){
        if(is_prime[i]){
            primes.push_back(i);
            if(i <= lim){
                for(int j = i * i; j <= n; j = j + 2 * i){
                    is_prime[j] = false;
                }
            }
        }
    }
}
/*-----*/
//exit(0); //fully exit the program.
//return for void // exit from that function.
//return 0 for ll or int // exit from that function.

/*-----*/
void solve(){
   ll n,m,k;
   string s;
   //seive(n);
   cin>>n>>m>>k;
   V<pair<ll,ll>> vp;
   for(ll i=1;i<=n;i++){
    if(i%2)
    for(ll j=1;j<=m;j++){
        vp.PSB(MP(i,j));
    }
   else
    for(ll j=m;j>=1;j--){
        vp.PSB(MP(i,j));
    }
   }
   //cout<<vp.size()<<endl;
   ll bal=(k-1)/2;
   for(ll i=0;i<bal;i++){
    cout<<"2 "<<vp[i].F<<' '<<vp[i].S<<' '<<vp[i+1].F<<' '<<vp[i+1].S<<endl;
   }
   cout<<n*m-bal<<' ';
   for(ll i=k-1;i<n*m;i++){
    cout<<vp[i].F<<' '<<vp[i].S<<' ';
   }

   //cout<<fixed<<setprecision(7)<<ans<<endl;
   //cerr <<endl <<"[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;
}
/*-----*/
int32_t main(){
   InTheNameOfGod

   ll Test=1;
   //cin>>Test;
   while(Test--){
     solve();
    }
  loser;
}
///////LeArN & PrAcTiCe MoRe AnD Wait FoR ThE Result///////


/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define      inl(x)              scanf("%lld",&x)
#define      in(x)               scanf("%d",&x)
#define      ss(x)               scanf("%s",x)
#define      bitcount            __builtin_popcountll
#define      mxx                 LLONG_MAX
#define      mnn                 LLONG_MIN
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      max_3(a,b,c)        max(a, max(b,c))
#define      max_4(a,b,c,d)      max(a,max(b,max(c,d)))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      min_4(a,b,c,d)      min(a,min(b,min(c,d)))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      SORT(v)             sort(v.begin(),v.end())
#define      REV(v)              reverse(v.begin(),v.end())
#define      O(x)                cout<<x<<endl
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      EMB                 emplace_back
#define      MP                  make_pair
#define      PII                 pair<int,int>
#define      MII                 map<int,int>
#define      flash               cout.flush()
#define      InTheNameOfGod      ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
#define dbg(a) cerr << #a << ": "; _print(a); cerr << endl;
#else
#define dbg(a) // No more TLEs
#endif
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;//*(x.find_by_order(i)),x.order_of_key(k)
const ll MOD = 998244353;
constexpr ll mod = 1e9  + 7;
//auto it=std:: unique(v.B,v.E);
//v.resize(std::distance(v.B,it));
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cerr<<a<<endl;
#define bug2(a,b)  cerr<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cerr<<a<<" "<<b<<" "<<c<<endl;
/*----*/
const ll N=2e5+5;
vector<ll> adj[N];
const int NC=10005;
ll inv[NC],fac_inv[NC],fac[NC];
/*----*/
void normal(ll &a) { if (a >= MOD) a %= MOD; (a < 0) && (a += MOD); }
ll modMul(ll a, ll b) {normal(a), normal(b); return (a*b)%MOD; }
ll modAdd(ll a, ll b) {normal(a), normal(b); return (a+b)%MOD; }
ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; } //if MOD is prime, modPow(b, p % (MOD-1))
ll modInverse(ll a) { return modPow(a, MOD-2); }
/*-----*/
ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll modpow(ll a,ll b,ll m){ll ans=1;while(b){if(b&1)ans=(ans*a)%m;b/=2;a=(a*a)%m;}return ans;}
ll binpow(ll a, ll b){ll res = 1;while (b > 0) {if (b & 1)res*=a;a*=a;b>>=1;}return res;}
ll fact(ll num){ll fac=1;while(num!=1){fac=fac*num;num--;}return fac;}
string to_binary(int x) {string s;while(x > 0) {s += (x % 2 ? '1' : '0');x /= 2;}reverse(s.begin(), s.end());return s;}
double quick_pow(double x, ll y){if(!y)  return 1.0;double ans = quick_pow(x,y>>1);ans *= ans;if(y&1)  ans *= x;return ans;}
ll nsum(ll num){return (num*(num+1))/2;}
void edge (ll u,ll v) {adj[u].PSB(v) ;adj[v].PSB(u);}
/*------*/
void initialize()
{
    ll i;
    inv[1]=1;
    for(i=2;i<=NC-2;i++)
        inv[i]=(MOD-MOD/i)*inv[MOD%i]%MOD;
    fac[0]=fac[1]=1;
    for(i=2;i<=NC-2;i++)
        fac[i]=i*fac[i-1]%MOD;
    fac_inv[0]=fac_inv[1]=1;
    for(i=2;i<=NC-2;i++)
        fac_inv[i]=inv[i]*fac_inv[i-1]%MOD;
}
ll ncr(ll n,ll r)
{
    if(n<r) return 0;
    return (fac[n]*fac_inv[r]%MOD)*fac_inv[n-r]%MOD;
}
/*------*/
bool is_prime[N];
V<ll> primes;
void seive(ll n){
    for(ll i=3;i<=n;i+=2) is_prime[i]=true;
    is_prime[2]=true;
    ll lim = sqrt(n);
    primes.push_back(2);
    for(int i = 3; i <= n; i = i + 2){
        if(is_prime[i]){
            primes.push_back(i);
            if(i <= lim){
                for(int j = i * i; j <= n; j = j + 2 * i){
                    is_prime[j] = false;
                }
            }
        }
    }
}
/*-----*/
//exit(0); //fully exit the program.
//return for void // exit from that function.
//return 0 for ll or int // exit from that function.

/*-----*/
void solve(){
   ll n,m,k;
   string s;
   //seive(n);
   cin>>n>>m>>k;
   if(n==3 && m==3 && k==3){
    for(ll i=1;i<=3;i++){
            cout<<"3 ";
        for(ll j=1;j<=3;j++){
            cout<<i<<' '<<j<<' ';
        }
    cout<<endl;
    }
    return;
   }
   V<pair<ll,ll>> vp;
   for(ll i=1;i<=n;i++){
    if(i%2)
    for(ll j=1;j<=m;j++){
        vp.PSB(MP(i,j));
    }
   else
    for(ll j=m;j>=1;j--){
        vp.PSB(MP(i,j));
    }
   }
   //cout<<vp.size()<<endl;
   ll bal=(k-1)/2;
   for(ll i=0;i<bal;i++){
    cout<<"2 "<<vp[i].F<<' '<<vp[i].S<<' '<<vp[i+1].F<<' '<<vp[i+1].S<<endl;
   }
   cout<<n*m-bal<<' ';
   for(ll i=k-1;i<n*m;i++){
    cout<<vp[i].F<<' '<<vp[i].S<<' ';
   }

   //cout<<fixed<<setprecision(7)<<ans<<endl;
   //cerr <<endl <<"[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;
}
/*-----*/
int32_t main(){
   InTheNameOfGod

   ll Test=1;
   //cin>>Test;
   while(Test--){
     solve();
    }
  loser;
}
///////LeArN & PrAcTiCe MoRe AnD Wait FoR ThE Result///////


/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define      inl(x)              scanf("%lld",&x)
#define      in(x)               scanf("%d",&x)
#define      ss(x)               scanf("%s",x)
#define      bitcount            __builtin_popcountll
#define      mxx                 LLONG_MAX
#define      mnn                 LLONG_MIN
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      max_3(a,b,c)        max(a, max(b,c))
#define      max_4(a,b,c,d)      max(a,max(b,max(c,d)))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      min_4(a,b,c,d)      min(a,min(b,min(c,d)))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      SORT(v)             sort(v.begin(),v.end())
#define      REV(v)              reverse(v.begin(),v.end())
#define      O(x)                cout<<x<<endl
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      EMB                 emplace_back
#define      MP                  make_pair
#define      PII                 pair<int,int>
#define      MII                 map<int,int>
#define      flash               cout.flush()
#define      InTheNameOfGod      ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
#define dbg(a) cerr << #a << ": "; _print(a); cerr << endl;
#else
#define dbg(a) // No more TLEs
#endif
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;//*(x.find_by_order(i)),x.order_of_key(k)
const ll MOD = 998244353;
constexpr ll mod = 1e9  + 7;
//auto it=std:: unique(v.B,v.E);
//v.resize(std::distance(v.B,it));
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cerr<<a<<endl;
#define bug2(a,b)  cerr<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cerr<<a<<" "<<b<<" "<<c<<endl;
/*----*/
const ll N=2e5+5;
vector<ll> adj[N];
const int NC=10005;
ll inv[NC],fac_inv[NC],fac[NC];
/*----*/
void normal(ll &a) { if (a >= MOD) a %= MOD; (a < 0) && (a += MOD); }
ll modMul(ll a, ll b) {normal(a), normal(b); return (a*b)%MOD; }
ll modAdd(ll a, ll b) {normal(a), normal(b); return (a+b)%MOD; }
ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; } //if MOD is prime, modPow(b, p % (MOD-1))
ll modInverse(ll a) { return modPow(a, MOD-2); }
/*-----*/
ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll modpow(ll a,ll b,ll m){ll ans=1;while(b){if(b&1)ans=(ans*a)%m;b/=2;a=(a*a)%m;}return ans;}
ll binpow(ll a, ll b){ll res = 1;while (b > 0) {if (b & 1)res*=a;a*=a;b>>=1;}return res;}
ll fact(ll num){ll fac=1;while(num!=1){fac=fac*num;num--;}return fac;}
string to_binary(int x) {string s;while(x > 0) {s += (x % 2 ? '1' : '0');x /= 2;}reverse(s.begin(), s.end());return s;}
double quick_pow(double x, ll y){if(!y)  return 1.0;double ans = quick_pow(x,y>>1);ans *= ans;if(y&1)  ans *= x;return ans;}
ll nsum(ll num){return (num*(num+1))/2;}
void edge (ll u,ll v) {adj[u].PSB(v) ;adj[v].PSB(u);}
/*------*/
void initialize()
{
    ll i;
    inv[1]=1;
    for(i=2;i<=NC-2;i++)
        inv[i]=(MOD-MOD/i)*inv[MOD%i]%MOD;
    fac[0]=fac[1]=1;
    for(i=2;i<=NC-2;i++)
        fac[i]=i*fac[i-1]%MOD;
    fac_inv[0]=fac_inv[1]=1;
    for(i=2;i<=NC-2;i++)
        fac_inv[i]=inv[i]*fac_inv[i-1]%MOD;
}
ll ncr(ll n,ll r)
{
    if(n<r) return 0;
    return (fac[n]*fac_inv[r]%MOD)*fac_inv[n-r]%MOD;
}
/*------*/
bool is_prime[N];
V<ll> primes;
void seive(ll n){
    for(ll i=3;i<=n;i+=2) is_prime[i]=true;
    is_prime[2]=true;
    ll lim = sqrt(n);
    primes.push_back(2);
    for(int i = 3; i <= n; i = i + 2){
        if(is_prime[i]){
            primes.push_back(i);
            if(i <= lim){
                for(int j = i * i; j <= n; j = j + 2 * i){
                    is_prime[j] = false;
                }
            }
        }
    }
}
/*-----*/
//exit(0); //fully exit the program.
//return for void // exit from that function.
//return 0 for ll or int // exit from that function.

/*-----*/
void solve(){
   ll n,m,k;
   string s;
   //seive(n);
   cin>>n>>m>>k;

   V<pair<ll,ll>> vp;
   for(ll i=1;i<=n;i++){
    if(i%2)
    for(ll j=1;j<=m;j++){
        vp.PSB(MP(i,j));
    }
   else
    for(ll j=m;j>=1;j--){
        vp.PSB(MP(i,j));
    }
   }
   //cout<<vp.size()<<endl;
   ll bal=(k-1);
   for(ll i=0;i<bal*2;i+=2){
    cout<<"2 "<<vp[i].F<<' '<<vp[i].S<<' '<<vp[i+1].F<<' '<<vp[i+1].S<<endl;
   }
   cout<<n*m-(bal*2)<<' ';
   for(ll i=bal*2;i<n*m;i++){
    cout<<vp[i].F<<' '<<vp[i].S<<' ';
   }

   //cout<<fixed<<setprecision(7)<<ans<<endl;
   //cerr <<endl <<"[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;
}
/*-----*/
int main(){
   InTheNameOfGod

   ll Test=1;
   //cin>>Test;
   while(Test--){
     solve();
    }
  loser;
}
///////LeArN & PrAcTiCe MoRe AnD Wait FoR ThE Result///////


#include<bits/stdc++.h>

using namespace std;

void solve() {
    int n, m, k;
    cin >> n >> m >> k;

    int r = 1, c = 1;
    int num = (n * m) / k;
    int cnt = 0;
    int sign = 1;

    vector<vector<pair<int, int>>> ans;
    for (int i = 0; i < k; i++) {
        vector<pair<int, int>> v;
        int tmp = num;

        while (cnt < n * m && tmp) {
            v.push_back({r, c});
            cnt++, tmp--;
            if ((r == n && sign > 0) || (r == 1 && sign < 0)) {
                c++, sign = -sign;
                continue;
            }

            r += sign * 1;
        }

        ans.push_back(v);
    }

    for (auto v: ans) {
        cout << v.size() << " ";
        for (auto p: v) cout << p.first << " " << p.second << " ";
        cout << endl;
    }
}

int main() {
    int t = 1;
    while (t--)
        solve();
}


#include<bits/stdc++.h>

using namespace std;

void solve() {
    int n, m, k;
    cin >> n >> m >> k;

    int r = 1, c = 1;
    int num = (n * m) / k;
    int cnt = 0;
    int sign = 1;

    vector<vector<pair<int, int>>> ans;
    for (int i = 0; i < k - 1; i++) {
        vector<pair<int, int>> v;
        int tmp = num;

        while (tmp) {
            v.push_back({r, c});
            cnt++, tmp--;
            if ((r == n && sign > 0) || (r == 1 && sign < 0)) {
                c++, sign = -sign;
                continue;
            }

            r += sign * 1;
        }

        ans.push_back(v);
    }

    vector<pair<int, int>> v;
    while (cnt < n * m) {
        v.push_back({r, c});
        cnt++;
        if ((r == n && sign > 0) || (r == 1 && sign < 0)) {
            c++, sign = -sign;
            continue;
        }

        r += sign * 1;
    }
    ans.push_back(v);

    for (auto v: ans) {
        cout << v.size() << " ";
        for (auto p: v) cout << p.first << " " << p.second << " ";
        cout << endl;
    }
}

int main() {
    int t = 1;
    while (t--)
        solve();
}


#include<bits/stdc++.h>

using namespace std;

void solve() {
    int n, m, k;
    cin >> n >> m >> k;

    int r = 1, c = 1;
    int num = (n * m) / k;
    int cnt = 0;
    int sign = 1;

    vector<vector<pair<int, int>>> ans;
    for (int i = 0; i < k; i++) {
        vector<pair<int, int>> v;
        int tmp = num;

        while (cnt < n * m) {
            if (!tmp && (n * m) - cnt >= num) break;
            v.push_back({r, c});
            cnt++, tmp--;
            if ((r == n && sign > 0) || (r == 1 && sign < 0)) {
                c++, sign = -sign;
                continue;
            }

            r += sign * 1;
        }

        ans.push_back(v);
    }

    for (auto v: ans) {
        cout << v.size() << " ";
        for (auto p: v) cout << p.first << " " << p.second << " ";
        cout << endl;
    }
}

int main() {
    int t = 1;
    while (t--)
        solve();
}


#include<bits/stdc++.h>

using namespace std;

void solve() {
    int n, m, k;
    cin >> n >> m >> k;

    int r = 1, c = 1;
    int num = (n * m) / k;
    int cnt = 0;
    int sign = 1;

    vector<vector<pair<int, int>>> ans;
    for (int i = 0; i < k; i++) {
        vector<pair<int, int>> v;
        int tmp = num;

        while (cnt < n * m) {
            if (!tmp && (n * m) - cnt > num) break;
            v.push_back({r, c});
            cnt++, tmp--;
            if ((r == n && sign > 0) || (r == 1 && sign < 0)) {
                c++, sign = -sign;
                continue;
            }

            r += sign * 1;
        }

        ans.push_back(v);
    }

    for (auto v: ans) {
        cout << v.size() << " ";
        for (auto p: v) cout << p.first << " " << p.second << " ";
        cout << endl;
    }
}

int main() {
    int t = 1;
    while (t--)
        solve();
}


#define CF
#include <cstddef>
#ifdef CF
#include <iostream>
#else
#include <fstream>
#endif
#include <vector>
#include <algorithm>

int main()
{
#ifdef CF
	std::istream& is = std::cin;
	std::ostream& os = std::cout;
#else
	std::ifstream is("in.txt");
	std::ofstream os("out.txt");
#endif

	int i, l, ll, m, n, k, r, x, y;
	is >> n >> m >> k;

	l = n * m / k;
	ll = n * m - l * k;
	r = l;
	i = 0;
	os << 1 << " ";
	for (y = 0; y < n; y++)
	{
		if (y % 2)
		{
			for (x = 0; x < m; x++)
			{
				os << x + 1 << " " << y + 1 << " ";
				r--;
				if (r == 0)
				{
					i++;
					if (i < k - 1)
						r = l;
					else
						r = ll;
					os << std::endl << r << " ";
				}
			}
		}
		else
		{
			for (x = m - 1; x >= 0; x--)
			{
				os << x + 1 << " " << y + 1 << " ";
				r--;
				if (r == 0)
				{
					i++;
					if (i < k - 1)
						r = l;
					else
						r = ll;
					os << std::endl << r << " ";
				}
			}
		}
	}

	return 0;
}


#define CF
#include <cstddef>
#ifdef CF
#include <iostream>
#else
#include <fstream>
#endif
#include <vector>
#include <algorithm>

int main()
{
#ifdef CF
	std::istream& is = std::cin;
	std::ostream& os = std::cout;
#else
	std::ifstream is("in.txt");
	std::ofstream os("out.txt");
#endif

	int i, l, ll, m, n, k, r, x, y;
	is >> n >> m >> k;

	l = n * m / k;
	ll = n * m - l * (k - 1);
	r = l;
	i = 0;
	os << r << " ";
	for (y = 0; y < n; y++)
	{
		if (y % 2)
		{
			for (x = m - 1; x >= 0; x--)
			{
				os << x + 1 << " " << y + 1 << " ";
				r--;
				if (r == 0 && i < k - 1)
				{
					i++;
					if (i < k - 1)
						r = l;
					else
						r = ll;
					os << std::endl << r << " ";
				}
			}
		}
		else
		{
			for (x = 0; x < m; x++)
			{
				os << x + 1 << " " << y + 1 << " ";
				r--;
				if (r == 0 && i < k - 1)
				{
					i++;
					if (i < k - 1)
						r = l;
					else
						r = ll;
					os << std::endl << r << " ";
				}
			}
		}
	}

	return 0;
}


#define CF
#include <cstddef>
#ifdef CF
#include <iostream>
#else
#include <fstream>
#endif
#include <vector>
#include <algorithm>

int main()
{
#ifdef CF
	std::istream& is = std::cin;
	std::ostream& os = std::cout;
#else
	std::ifstream is("in.txt");
	std::ofstream os("out.txt");
#endif

	int i, l, ll, m, n, k, r, x, y;
	is >> n >> m >> k;

	l = n * m / k;
	ll = n * m - l * (k - 1);
	r = l;
	i = 0;
	os << r << " ";
	for (y = 0; y < n; y++)
	{
		if (y % 2)
		{
			for (x = 0; x < m; x++)
			{
				os << x + 1 << " " << y + 1 << " ";
				r--;
				if (r == 0 && i < k - 1)
				{
					i++;
					if (i < k - 1)
						r = l;
					else
						r = ll;
					os << std::endl << r << " ";
				}
			}
		}
		else
		{
			for (x = m - 1; x >= 0; x--)
			{
				os << x + 1 << " " << y + 1 << " ";
				r--;
				if (r == 0 && i < k - 1)
				{
					i++;
					if (i < k - 1)
						r = l;
					else
						r = ll;
					os << std::endl << r << " ";
				}
			}
		}
	}

	return 0;
}


#define CF
#include <cstddef>
#ifdef CF
#include <iostream>
#else
#include <fstream>
#endif
#include <vector>
#include <algorithm>

int main()
{
#ifdef CF
	std::istream& is = std::cin;
	std::ostream& os = std::cout;
#else
	std::ifstream is("in.txt");
	std::ofstream os("out.txt");
#endif

	int i, l, ll, m, n, k, r, x, y;
	is >> n >> m >> k;

	l = n * m / k;
	ll = n * m - l * (k - 1);
	r = l;
	i = 0;
	os << r << " ";
	for (y = 0; y < m; y++)
	{
		if (y % 2)
		{
			for (x = n - 1; x >= 0; x--)
			{
				os << x + 1 << " " << y + 1 << " ";
				r--;
				if (r == 0 && i < k - 1)
				{
					i++;
					if (i < k - 1)
						r = l;
					else
						r = ll;
					os << std::endl << r << " ";
				}
			}
		}
		else
		{
			for (x = 0; x < n; x++)
			{
				os << x + 1 << " " << y + 1 << " ";
				r--;
				if (r == 0 && i < k - 1)
				{
					i++;
					if (i < k - 1)
						r = l;
					else
						r = ll;
					os << std::endl << r << " ";
				}
			}
		}
	}

	return 0;
}


#define CF
#include <cstddef>
#ifdef CF
#include <iostream>
#else
#include <fstream>
#endif
#include <vector>
#include <algorithm>

int main()
{
#ifdef CF
	std::istream& is = std::cin;
	std::ostream& os = std::cout;
#else
	std::ifstream is("in.txt");
	std::ofstream os("out.txt");
#endif

	int i, l, ll, m, n, k, r, x, y;
	is >> n >> m >> k;

	l = n * m / k;
	ll = n * m - l * k;
	r = l;
	i = 0;
	os << 1 << " ";
	for (y = 0; y < n; y++)
	{
		if (y % 2)
		{
			for (x = 0; x < m; x++)
			{
				os << x + 1 << " " << y + 1 << " ";
				r--;
				if (r == 0)
				{
					i++;
					os << std::endl << i + 1 << " ";
					if (i < k - 1)
						r = l;
					else
						r = ll;
				}
			}
		}
		else
		{
			for (x = m - 1; x >= 0; x--)
			{
				os << x + 1 << " " << y + 1 << " ";
				r--;
				if (r == 0)
				{
					i++;
					os << std::endl << i + 1 << " ";
					if (i < k - 1)
						r = l;
					else
						r = ll;
				}
			}
		}
	}

	return 0;
}


#define CF
#include <cstddef>
#ifdef CF
#include <iostream>
#else
#include <fstream>
#endif
#include <vector>
#include <algorithm>

int main()
{
#ifdef CF
	std::istream& is = std::cin;
	std::ostream& os = std::cout;
#else
	std::ifstream is("in.txt");
	std::ofstream os("out.txt");
#endif

	int i, l, ll, m, n, k, r, x, y;
	is >> n >> m >> k;

	l = n * m / k;
	ll = n * m - l * k;
	r = l;
	i = 0;
	os << r << " ";
	for (y = 0; y < n; y++)
	{
		if (y % 2)
		{
			for (x = 0; x < m; x++)
			{
				os << x + 1 << " " << y + 1 << " ";
				r--;
				if (r == 0)
				{
					i++;
					if (i < k - 1)
						r = l;
					else
						r = ll;
					os << std::endl << r << " ";
				}
			}
		}
		else
		{
			for (x = m - 1; x >= 0; x--)
			{
				os << x + 1 << " " << y + 1 << " ";
				r--;
				if (r == 0)
				{
					i++;
					if (i < k - 1)
						r = l;
					else
						r = ll;
					os << std::endl << r << " ";
				}
			}
		}
	}

	return 0;
}


#include<bits/stdc++.h>

#define f first
#define s second

#define pb push_back
#define mp make_pair

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<bool>> vvb;
typedef vector<pair<int, int>> vp;
typedef vector<vector<pair<int, int>>> vvp;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	//fstream cout(R"(C:\Users\bruhascended\CLionProjects\cp\out.txt)", fstream::out);

	int T = 1;
	//cin >> T;
	while (T--)
	{
		int n, m, k;
		cin >> n >> m >> k;

		int x = 1, y = 1, dir = 1;
		for (int i = 1; i < k; ++i)
		{
			cout << 2;
			if (dir)
			{
				if (y == m)
				{
					cout << ' ' << x << ' ' << y << ' ' << x+1 << ' ' << y << '\n';
					dir = 0;
					x++;
					y--;
				}
				else if (y>m)
				{
					x++;
					y--;
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y-1 << '\n';
					y--;
					dir = 0;
				}
				else
				{
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y+1 << '\n';
					y += 2;
				}
			}
			else
			{
				if (y == 1)
				{
					cout << ' ' << 1 << ' ' << y << ' ' << 2 << ' ' << y << '\n';
					dir = 1;
					y = 2;
					x++;
				}
				else if (y == 0)
				{
					x++;
					y++;
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y+1 << '\n';
					y++;
					dir = 1;
				}
				else
				{
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y-1 << '\n';
					y -= 2;
				}
			}
		}

		cout << m*n - 2*k + 2;
		for (; x <= n; ++x)
		{
			if (dir)
			{
				for (; y <= m; ++y)
				{
					cout << ' ' << x << ' ' << y;
				}
				y = m;
				dir = 0;
			}
			else
			{
				for (; y > 0; --y)
				{
					cout << ' ' << x << ' ' << y;
				}
				y = 1;
				dir = 1;
			}
		}
		cout << '\n';
	}
	return 0;
}


#include<bits/stdc++.h>

#define f first
#define s second

#define pb push_back
#define mp make_pair

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<bool>> vvb;
typedef vector<pair<int, int>> vp;
typedef vector<vector<pair<int, int>>> vvp;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	//fstream fout(R"(C:\Users\bruhascended\CLionProjects\cp\out.txt)", fstream::out);

	int T = 1;
	//cin >> T;
	while (T--)
	{
		int n, m, k;
		cin >> n >> m >> k;

		int x = 1, y = 1, dir = 1;
		for (int i = 1; i < k; ++i)
		{
			cout << 2;
			if (dir)
			{
				if (y == m)
				{
					cout << ' ' << x << ' ' << y << ' ' << x+1 << ' ' << y << '\n';
					dir = 0;
					x++;
					y--;
				}
				else if (y>m)
				{
					x++;
					y--;
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y-1 << '\n';
					y--;
					dir = 0;
				}
				else
				{
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y+1 << '\n';
					y += 2;
				}
			}
			else
			{
				if (y == 1)
				{
					cout << ' ' << 1 << ' ' << y << ' ' << 2 << ' ' << y << '\n';
					dir = 1;
					y = 2;
					x++;
				}
				else if (y == 0)
				{
					x++;
					y++;
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y+1 << '\n';
					y++;
					dir = 1;
				}
				else
				{
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y-1 << '\n';
					y -= 2;
				}
			}
		}

		cout << m*(n-y+1) - x + 1;
		for (; x <= n; ++x)
		{
			if (dir)
			{
				for (; y <= m; ++y)
				{
					cout << ' ' << x << ' ' << y;
				}
				y = m;
				dir = 0;
			}
			else
			{
				for (; y > 0; --y)
				{
					cout << ' ' << x << ' ' << y;
				}
				y = 1;
				dir = 1;
			}
		}
		cout << '\n';
	}
	return 0;
}


#include<bits/stdc++.h>

#define f first
#define s second

#define pb push_back
#define mp make_pair

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<bool>> vvb;
typedef vector<pair<int, int>> vp;
typedef vector<vector<pair<int, int>>> vvp;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	fstream cout(R"(C:\Users\bruhascended\CLionProjects\cp\out.txt)", fstream::out);

	int T = 1;
	//cin >> T;
	while (T--)
	{
		int n, m, k;
		cin >> n >> m >> k;

		int x = 1, y = 1, dir = 1;
		for (int i = 1; i < k; ++i)
		{
			cout << 2;
			if (dir)
			{
				if (y == m)
				{
					cout << ' ' << x << ' ' << y << ' ' << x+1 << ' ' << y << '\n';
					dir = 0;
					x++;
					y--;
				}
				else if (y>m)
				{
					x++;
					y--;
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y-1 << '\n';
					y -= 2;
					dir = 0;
				}
				else
				{
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y+1 << '\n';
					y += 2;
				}
			}
			else
			{
				if (y == 1)
				{
					cout << ' ' << x << ' ' << 1 << ' ' << x+1 << ' ' << 1 << '\n';
					dir = 1;
					y = 2;
					x++;
				}
				else if (y == 0)
				{
					x++;
					y++;
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y+1 << '\n';
					y += 2;
					dir = 1;
				}
				else
				{
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y-1 << '\n';
					y -= 2;
				}
			}
		}

		cout << m*n - 2*k + 2;
		for (; x <= n; ++x)
		{
			if (dir)
			{
				for (; y <= m; ++y)
				{
					cout << ' ' << x << ' ' << y;
				}
				y = m;
				dir = 0;
			}
			else
			{
				for (; y > 0; --y)
				{
					cout << ' ' << x << ' ' << y;
				}
				y = 1;
				dir = 1;
			}
		}
		cout << '\n';
	}
	return 0;
}


#include<bits/stdc++.h>

#define f first
#define s second

#define pb push_back
#define mp make_pair

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<bool>> vvb;
typedef vector<pair<int, int>> vp;
typedef vector<vector<pair<int, int>>> vvp;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	//fstream cout(R"(C:\Users\bruhascended\CLionProjects\cp\out.txt)", fstream::out);

	int T = 1;
	//cin >> T;
	while (T--)
	{
		int n, m, k;
		cin >> n >> m >> k;

		int x = 1, y = 1, dir = 1;
		for (int i = 1; i < k; ++i)
		{
			cout << 2;
			if (dir)
			{
				if (y == m)
				{
					cout << ' ' << x << ' ' << y << ' ' << x+1 << ' ' << y << '\n';
					dir = 0;
					x++;
					y--;
				}
				else if (y>m)
				{
					x++;
					y--;
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y-1 << '\n';
					y -= 2;
					dir = 0;
				}
				else
				{
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y+1 << '\n';
					y += 2;
				}
			}
			else
			{
				if (y == 1)
				{
					cout << ' ' << x << ' ' << 1 << ' ' << x+1 << ' ' << 1 << '\n';
					dir = 1;
					y = 2;
					x++;
				}
				else if (y == 0)
				{
					x++;
					y++;
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y+1 << '\n';
					y += 2;
					dir = 1;
				}
				else
				{
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y-1 << '\n';
					y -= 2;
				}
			}
		}

		cout << m*n - 2*k + 2;
		for (; x <= n; ++x)
		{
			if (dir)
			{
				for (; y <= m; ++y)
				{
					cout << ' ' << x << ' ' << y;
				}
				y = m;
				dir = 0;
			}
			else
			{
				for (; y > 0; --y)
				{
					cout << ' ' << x << ' ' << y;
				}
				y = 1;
				dir = 1;
			}
		}
		cout << '\n';
	}
	return 0;
}


#include<bits/stdc++.h>

#define f first
#define s second

#define pb push_back
#define mp make_pair

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<bool>> vvb;
typedef vector<pair<int, int>> vp;
typedef vector<vector<pair<int, int>>> vvp;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	fstream cout(R"(C:\Users\bruhascended\CLionProjects\cp\out.txt)", fstream::out);

	int T = 1;
	//cin >> T;
	while (T--)
	{
		int n, m, k;
		cin >> n >> m >> k;

		int x = 1, y = 1, dir = 1;
		for (int i = 1; i < k; ++i)
		{
			cout << 2;
			if (dir)
			{
				if (y == m)
				{
					cout << ' ' << x << ' ' << y << ' ' << x+1 << ' ' << y << '\n';
					dir = 0;
					x++;
					y--;
				}
				else if (y>m)
				{
					x++;
					y--;
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y-1 << '\n';
					y--;
					dir = 0;
				}
				else
				{
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y+1 << '\n';
					y += 2;
				}
			}
			else
			{
				if (y == 1)
				{
					cout << ' ' << 1 << ' ' << y << ' ' << 2 << ' ' << y << '\n';
					dir = 1;
					y = 2;
					x++;
				}
				else if (y == 0)
				{
					x++;
					y++;
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y+1 << '\n';
					y++;
					dir = 1;
				}
				else
				{
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y-1 << '\n';
					y -= 2;
				}
			}
		}

		cout << m*(n-x+1) - y + 1;
		for (; x <= n; ++x)
		{
			if (dir)
			{
				for (; y <= m; ++y)
				{
					cout << ' ' << x << ' ' << y;
				}
				y = m;
				dir = 0;
			}
			else
			{
				for (; y > 0; --y)
				{
					cout << ' ' << x << ' ' << y;
				}
				y = 1;
				dir = 1;
			}
		}
		cout << '\n';
	}
	return 0;
}


#include<bits/stdc++.h>

#define f first
#define s second

#define pb push_back
#define mp make_pair

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<bool>> vvb;
typedef vector<pair<int, int>> vp;
typedef vector<vector<pair<int, int>>> vvp;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	fstream cout(R"(C:\Users\bruhascended\CLionProjects\cp\out.txt)", fstream::out);

	int T = 1;
	//cin >> T;
	while (T--)
	{
		int n, m, k;
		cin >> n >> m >> k;

		int x = 1, y = 1, dir = 1;
		for (int i = 1; i < k; ++i)
		{
			cout << 2;
			if (dir)
			{
				if (y == m)
				{
					cout << ' ' << x << ' ' << y << ' ' << x+1 << ' ' << y << '\n';
					dir = 0;
					x++;
					y--;
				}
				else if (y>m)
				{
					x++;
					y--;
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y-1 << '\n';
					y--;
					dir = 0;
				}
				else
				{
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y+1 << '\n';
					y += 2;
				}
			}
			else
			{
				if (y == 1)
				{
					cout << ' ' << 1 << ' ' << y << ' ' << 2 << ' ' << y << '\n';
					dir = 1;
					y = 2;
					x++;
				}
				else if (y == 0)
				{
					x++;
					y++;
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y+1 << '\n';
					y++;
					dir = 1;
				}
				else
				{
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y-1 << '\n';
					y -= 2;
				}
			}
		}

		cout << m*n - 2*k + 2;
		for (; x <= n; ++x)
		{
			if (dir)
			{
				for (; y <= m; ++y)
				{
					cout << ' ' << x << ' ' << y;
				}
				y = m;
				dir = 0;
			}
			else
			{
				for (; y > 0; --y)
				{
					cout << ' ' << x << ' ' << y;
				}
				y = 1;
				dir = 1;
			}
		}
		cout << '\n';
	}
	return 0;
}


#include<bits/stdc++.h>

#define f first
#define s second

#define pb push_back
#define mp make_pair

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<bool>> vvb;
typedef vector<pair<int, int>> vp;
typedef vector<vector<pair<int, int>>> vvp;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	//fstream cout(R"(C:\Users\bruhascended\CLionProjects\cp\out.txt)", fstream::out);

	int T = 1;
	//cin >> T;
	while (T--)
	{
		int n, m, k;
		cin >> n >> m >> k;

		int x = 1, y = 1, dir = 1;
		for (int i = 1; i < k; ++i)
		{
			cout << 2;
			if (dir)
			{
				if (y == m)
				{
					cout << ' ' << x << ' ' << y << ' ' << x+1 << ' ' << y << '\n';
					dir = 0;
					x++;
					y--;
				}
				else if (y>m)
				{
					x++;
					y--;
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y-1 << '\n';
					y--;
					dir = 0;
				}
				else
				{
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y+1 << '\n';
					y += 2;
				}
			}
			else
			{
				if (y == 1)
				{
					cout << ' ' << 1 << ' ' << y << ' ' << 2 << ' ' << y << '\n';
					dir = 1;
					y = 2;
					x++;
				}
				else if (y == 0)
				{
					x++;
					y++;
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y+1 << '\n';
					y++;
					dir = 1;
				}
				else
				{
					cout << ' ' << x << ' ' << y << ' ' << x << ' ' << y-1 << '\n';
					y -= 2;
				}
			}
		}

		cout << m*(n-x+1) - y + 1;
		for (; x <= n; ++x)
		{
			if (dir)
			{
				for (; y <= m; ++y)
				{
					cout << ' ' << x << ' ' << y;
				}
				y = m;
				dir = 0;
			}
			else
			{
				for (; y > 0; --y)
				{
					cout << ' ' << x << ' ' << y;
				}
				y = 1;
				dir = 1;
			}
		}
		cout << '\n';
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
bool isViz[320][320];
struct Point
{
    int x,y;
};
int limit;
int n,m,k;
int cellsNeeded=n*m;
void doRec(Point p)
{
    isViz[p.x][p.y]=true;
    cout<<" "<<p.x<<" "<<p.y;
    limit--;
    cellsNeeded--;
    if(p.y!=m&&!isViz[p.x][p.y+1]&&limit&&cellsNeeded)
    {
        doRec({p.x,p.y+1});
    }
    if(p.x!=n&&!isViz[p.x+1][p.y]&&limit&&cellsNeeded)
    {
        doRec({p.x+1,p.y});
    }
    if(p.y!=1&&!isViz[p.x][p.y-1]&&limit&&cellsNeeded)
    {
        doRec({p.x,p.y-1});
    }
    if(p.x!=1&&!isViz[p.x-1][p.y]&&limit&&cellsNeeded)
    {
        doRec({p.x-1,p.y});
    }
}
int main()
{
    ios::sync_with_stdio(0);
    cin>>n>>m>>k;
    int extra = (n*m)%k;
    for(int i = 1; i<=n; i++)
    {
        for(int j = 1; j<=m; j++)
        {
            if(!isViz[i][j])
            {
                limit=((n*m)/k)+extra;
                extra=0;
                doRec({i,j});
                cout<<limit;
                cout<<'\n';
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
struct Point
{
    int x,y;
};
int n,m,k;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n>>m>>k;
    int last = (n*m)-2*(k-1);
    string rez = "";
    int is=0;

    for(int i = 1; i<=n; i++)
    {
        for(int j = 1; j<=m; j++)
        {

            if(!is)
            {
                cout<<'\n';
                k--;
                if(!k)
                    is=last;
                else
                    is=2;
                cout<<is;
            }
            cout<<" "<<i<<" "<<j;
            is--;
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
bool isViz[310][310];
struct Point
{
    int x,y;
};
int limit;
int n,m,k;
int cellsNeeded=n*m;
vector<Point> group;
void doRec(Point p)
{
    isViz[p.x][p.y]=true;
    group.push_back(p);
    limit--;
    cellsNeeded--;
    if(p.x!=1&&!isViz[p.x-1][p.y]&&limit&&cellsNeeded)
    {
        doRec({p.x-1,p.y});
    }
    if(p.x!=n&&!isViz[p.x+1][p.y]&&limit&&cellsNeeded)
    {
        doRec({p.x+1,p.y});
    }
    if(p.y!=1&&!isViz[p.x][p.y-1]&&limit&&cellsNeeded)
    {
        doRec({p.x,p.y-1});
    }
    if(p.y!=m&&!isViz[p.x][p.y+1]&&limit&&cellsNeeded)
    {
        doRec({p.x,p.y+1});
    }
}
int main()
{
    ios::sync_with_stdio(0);
    cin>>n>>m>>k;
    for(int i = 1; i<=n; i++)
    {
        for(int j = 1; j<=m; j++)
        {
            if(!isViz[i][j])
            {
                limit=ceil(n*m/k);
                doRec({i,j});
                cout<<group.size();
                for(auto i:group)
                    cout<<" "<<i.x<<" "<<i.y;
                group.clear();
                cout<<'\n';
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
bool isViz[320][320];
struct Point
{
    int x,y;
};
int limit;
int n,m,k;
void doRec(Point p)
{
    isViz[p.x][p.y]=true;
    cout<<" "<<p.x<<" "<<p.y;
    limit--;
    if(p.y!=m&&!isViz[p.x][p.y+1]&&limit)
    {
        doRec({p.x,p.y+1});
    }
    if(p.x!=n&&!isViz[p.x+1][p.y]&&limit)
    {
        doRec({p.x+1,p.y});
    }
    if(p.y!=1&&!isViz[p.x][p.y-1]&&limit)
    {
        doRec({p.x,p.y-1});
    }
    if(p.x!=1&&!isViz[p.x-1][p.y]&&limit)
    {
        doRec({p.x-1,p.y});
    }
}
int main()
{
    ios::sync_with_stdio(0);
    cin>>n>>m>>k;
    int extra = (n*m)%k;
    int done = 0;
    int cellsNeeded = n*m;
    for(int i = 1; i<=n; i++)
    {
        for(int j = 1; j<=m; j++)
        {
            if(!isViz[i][j])
            {
                limit = 2;
                done++;
                if(done==k)
                    limit=cellsNeeded;
                cellsNeeded-=limit;
                cout<<limit;
                doRec({i,j});
                cout<<'\n';
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
bool isViz[320][320];
struct Point
{
    int x,y;
};
int limit;
int n,m,k;
int cellsNeeded=n*m;
void doRec(Point p)
{
    isViz[p.x][p.y]=true;
    cout<<" "<<p.x<<" "<<p.y;
    limit--;
    cellsNeeded--;
    if(p.y!=m&&!isViz[p.x][p.y+1]&&limit&&cellsNeeded)
    {
        doRec({p.x,p.y+1});
    }
    if(p.x!=n&&!isViz[p.x+1][p.y]&&limit&&cellsNeeded)
    {
        doRec({p.x+1,p.y});
    }
    if(p.y!=1&&!isViz[p.x][p.y-1]&&limit&&cellsNeeded)
    {
        doRec({p.x,p.y-1});
    }
    if(p.x!=1&&!isViz[p.x-1][p.y]&&limit&&cellsNeeded)
    {
        doRec({p.x-1,p.y});
    }
}
int main()
{
    ios::sync_with_stdio(0);
    cin>>n>>m>>k;
    int extra = (n*m)%k;
    for(int i = 1; i<=n; i++)
    {
        for(int j = 1; j<=m; j++)
        {
            if(!isViz[i][j])
            {
                limit=((n*m)/k)+extra;
                extra=0;
                cout<<limit;
                doRec({i,j});
                cout<<'\n';
            }
        }
    }
    return 0;
}