#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
// #define mp         make_pair
#define MAX 200005
#define CHAR_SIZE 26
#define N 301
using namespace std;

ll vis[N][N];
ll n,m,k;

void dfs(ll i,ll j,ll len)
{
	vis[i][j]=1;

	cout<<" "<<i+1<<" "<<j+1;

	if(len==1)
		return;

	if(j<m-1 && vis[i][j+1]==0)
		dfs(i,j+1,len-1);

	else if(j>0 && vis[i][j-1]==0)
		dfs(i,j-1,len-1);

	else if(i<n-1 && vis[i+1][j]==0)
		dfs(i+1,j,len-1);

}

void solve(int cno)
{
	ll i,j,l;
	cin>>n>>m>>k;

	ll d=2*(k-1);
	ll mx=(n*m)-d;

	// cout<<mn<<" "<<mx<<endl;
	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			vis[i][j]=0;
		}
	}
	ll cnt=1;
	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			if(vis[i][j]==0)
			{
				if(cnt<k)
				{
					cnt++;
					cout<<2;
					dfs(i,j,2);
					cout<<endl;
				}
				else if(cnt==k)
				{
					cnt++;
					cout<<(n*m)-2*(k-1);
					dfs(i,j,mx);
				}
			}
		}
	}

	// cout<<mn<<" "<<mx<<endl;

}
// cout<<mn<<endl;
/*

*/

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int TESTS=1;
	// cin>>TESTS;
	ll  i=1;
	while(TESTS--)
	{
		solve(i);
		i++;
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
// #define mp         make_pair
#define MAX 200005
#define CHAR_SIZE 26
#define N 301
using namespace std;

ll vis[N][N];
ll n,m,k;

void dfs(ll i,ll j,ll len)
{
	vis[i][j]=1;

	cout<<i+1<<" "<<j+1<<" ";

	if(len==1)
		return;

	if(j<m-1 && vis[i][j+1]==0)
		dfs(i,j+1,len-1);

	else if(j>0 && vis[i][j-1]==0)
		dfs(i,j-1,len-1);

	else if(i<n-1 && vis[i+1][j]==0)
		dfs(i+1,j,len-1);

}

void solve(int cno)
{
	ll i,j,l;
	cin>>n>>m>>k;

	ll d=(n*m)/k;

	ll mn=d;
	ll mx=d+((n*m)%k);

	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			vis[i][j]=0;
		}
	}

	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			if(vis[i][j]==0)
			{
				if(k>1)
				{
					k--;
					cout<<mn<<" ";
					dfs(i,j,mn);
					cout<<endl;
				}
				else
				{

						cout<<mx<<" ";
						dfs(i,j,mx);
						cout<<endl;

				}
			}
		}
	}

}
// cout<<mn<<endl;
/*

*/

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int TESTS=1;
	// cin>>TESTS;
	ll  i=1;
	while(TESTS--)
	{
		solve(i);
		i++;
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
// #define mp         make_pair
#define MAX 200005
#define CHAR_SIZE 26
#define N 301
using namespace std;

ll vis[N][N];
ll n,m,k;

void dfs(ll i,ll j,ll len)
{
	vis[i][j]=1;

	cout<<" "<<i+1<<" "<<j+1;

	if(len==1)
		return;

	if(j<m-1 && vis[i][j+1]==0)
		dfs(i,j+1,len-1);

	else if(j>0 && vis[i][j-1]==0)
		dfs(i,j-1,len-1);

	else if(i<n-1 && vis[i+1][j]==0)
		dfs(i+1,j,len-1);

}

void solve(int cno)
{
	ll i,j,l;
	cin>>n>>m>>k;

	ll d=(n*m)/k;

	ll mn=d;
	ll mx=d+((n*m)%k);

	// cout<<mn<<" "<<mx<<endl;

	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			vis[i][j]=0;
		}
	}
	ll cnt=1;
	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			if(vis[i][j]==0)
			{
				if(cnt<k)
				{
					cnt++;
					cout<<mn;
					dfs(i,j,mn);
					cout<<endl;
				}
				else if(cnt==k)
				{
					cnt++;
					cout<<mx;
					dfs(i,j,mx);
					break;
				}
			}
		}
	}

	// cout<<mn<<" "<<mx<<endl;

}
// cout<<mn<<endl;
/*

*/

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int TESTS=1;
	// cin>>TESTS;
	ll  i=1;
	while(TESTS--)
	{
		solve(i);
		i++;
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
// #define mp         make_pair
#define MAX 200005
#define CHAR_SIZE 26
#define N 301
using namespace std;

ll vis[N][N];
ll n,m,k,mx,mn=2;

void dfs(ll i,ll j,ll len)
{
	if(len==2 || len==mx)
		cout<<len<<" ";
	vis[i][j]=1;

	cout<<i+1<<" "<<j+1<<" ";

	if(len==1)
	{
		k--;
		cout<<endl;
		if(k==1)
			len=mx+1;
		else
			len=mn+1;
	}

	if(j<m-1 && vis[i][j+1]==0)
		dfs(i,j+1,len-1);

	else if(j>0 && vis[i][j-1]==0)
		dfs(i,j-1,len-1);

	else if(i<n-1 && vis[i+1][j]==0)
		dfs(i+1,j,len-1);

}

void solve(int cno)
{
	ll i,j,l;
	cin>>n>>m>>k;

	ll d=2*(k-1);
	mx=(n*m)-d;

	// cout<<mn<<" "<<mx<<endl;
	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			vis[i][j]=0;
		}
	}

	if(k==1)
	{
		dfs(0,0,n*m);
	}
	else
	{
		dfs(0,0,2);
	}

	// cout<<mn<<" "<<mx<<endl;

}
// cout<<mn<<endl;
/*

*/

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int TESTS=1;
	// cin>>TESTS;
	ll  i=1;
	while(TESTS--)
	{
		solve(i);
		i++;
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, m, k;
int a = 1, b = 0;
bool v[500][500];
vector<pair<int, int>> A[100005];

void dfs(int x = 1, int y = 1)
{
    if (x < 1 || y < 1 || x > n || y > m || v[x][y])
    {
        return;
    }
    if (b == 2 && a < k)
    {
        a++;
        b = 0;
    }
    b++;
    v[x][y] = true;
    A[a].push_back({x, y});
    dfs(x + 1, y);
    dfs(x, y + 1);
    dfs(x - 1, y);
    dfs(x, y - 1);
}

int main()
{
    cin >> n >> m >> k;

    dfs();
    for (int i = 1; i < k + 1; i++)
    {
        cout << A[i].size() << " ";
        for (auto j : A[i])
        {
            cout << j.first << " " << j.second << " ";
        }
        cout << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define ll unsigned long long
int main()
{
    int n,m,k;
    cin>>n>>m>>k;
    int state=0;
    int c=1,r=1,a=0;
    while(k>0)
    {
        if(k!=1)
        {
            if(state==0)
            {
                if(c!=m || m%2==0)
                {
                    if(c==m)
                    {
                        r++;
                        c=1;
                    }
                    int k1=c;
                    cout<<2<<" ";
                    for(int i=k1 ; i<k1+2 ; i++)
                    {
                        c++;
                        cout<<r<<" "<<i<<" ";
                    }
                    cout<<endl;
                    if(a==1)
                    {
                        c--;
                    }
                    k--;

                }
                else
                {
                    cout<<2<<" ";
                    for(int i=0 ; i<2 ; i++)
                    {
                        cout<<r<<" "<<c<<" ";
                        r++;
                    }
                    cout<<endl;
                    r--;
                    k--;
                    c--;
                    state=1;
                }
            }
            else
            {
                if(c!=1)
                {
                    cout<<2<<" ";
                    int k1=c;
                    for(int i=k1 ; i>k1-2 ; i--)
                    {
                        cout<<r<<" "<<i<<" ";
                        c--;
                    }
                    cout<<endl;
                    c++;
                    k--;
                }
                else
                {
                    r++;
                    state=0;
                }
            }
        }
        else
        {
            //cout<<k<<endl;
            //cout<<r<<" "<<c<<endl;
            vector<pair<int,int> >v;
            int s1;
            if(state==0)
            {
                s1=0;
            }
            else
            {
                s1=1;
            }
            while(r!=n+1)
            {

                if(s1==0)
                {
                    for(int j=c ; j<=m ; j++)
                    {
                        //cout<<r<<" "<<j<<" ";
                        v.push_back({r,j});
                        c++;
                    }
                    r++;
                    s1=1;
                    c=m;
                }
                else
                {
                    for(int j=c ; j>=1 ; j--)
                    {
                        v.push_back({r,j});
                        //cout<<r<<" "<<j<<" ";
                    }
                    c=1;
                    r++;
                    s1=0;
                }
            }
            cout<<v.size()<<" ";
            for(int i=0 ; i<v.size() ; i++)
            {
                cout<<v[i].first<<" "<<v[i].second<<" ";
            }
            cout<<endl;
            k--;
            break;
        }
    }

}


#include <bits/stdc++.h>
using namespace std;
#define ll unsigned long long
int main()
{
    int n,m,k;
    cin>>n>>m>>k;
    int state=0;
    int c=1,r=1,a=0;
    while(k>0)
    {
        if(k!=1)
        {
            if(state==0)
            {
                if(c!=m || m%2==0)
                {
                    int k1=c;
                    cout<<2<<" ";
                    for(int i=k1 ; i<k1+2 ; i++)
                    {
                        c++;
                        cout<<r<<" "<<i<<" ";
                    }
                    if(c==m+1)
                    {
                        r++;
                        c=1;
                    }
                    cout<<endl;
                    k--;

                }
                else
                {
                    cout<<2<<" ";
                    for(int i=0 ; i<2 ; i++)
                    {
                        cout<<r<<" "<<c<<" ";
                        r++;
                    }
                    cout<<endl;
                    r--;
                    k--;
                    c--;
                    state=1;
                }
            }
            else
            {
                if(c!=1)
                {
                    cout<<2<<" ";
                    int k1=c;
                    for(int i=k1 ; i>k1-2 ; i--)
                    {
                        cout<<r<<" "<<i<<" ";
                        c--;
                    }
                    cout<<endl;
                    if(c==0)
                    {
                        c++,r++,state=0;
                    }
                    k--;
                }
                else
                {
                    r++;
                    state=0;
                }
            }
        }
        else
        {
            //cout<<k<<endl;
            //cout<<r<<" "<<c<<endl;
            vector<pair<int,int> >v;
            int s1;
            if(state==0)
            {
                s1=0;
            }
            else
            {
                s1=1;
            }
            while(r!=n+1)
            {

                if(s1==0)
                {
                    for(int j=c ; j<=m ; j++)
                    {
                        //cout<<r<<" "<<j<<" ";
                        v.push_back({r,j});
                        c++;
                    }
                    r++;
                    s1=1;
                    c=m;
                }
                else
                {
                    for(int j=c ; j>=1 ; j--)
                    {
                        v.push_back({r,j});
                        //cout<<r<<" "<<j<<" ";
                    }
                    c=1;
                    r++;
                    s1=0;
                }
            }
            cout<<v.size()<<" ";
            for(int i=0 ; i<v.size() ; i++)
            {
                cout<<v[i].first<<" "<<v[i].second<<" ";
            }
            cout<<endl;
            k--;
            break;
        }
    }

}


#include <bits/stdc++.h>
using namespace std;
#define ll unsigned long long
int main()
{
    int n,m,k;
    cin>>n>>m>>k;
    int state=0;
    int c=1,r=1,a=0;
    while(k>0)
    {
        if(k!=1)
        {
            if(state==0)
            {
                if(c!=m || m%2==0)
                {
                    if(c==m)
                    {
                        r++;
                        c=1;
                    }
                    int k1=c;
                    cout<<2<<" ";
                    for(int i=k1 ; i<k1+2 ; i++)
                    {
                        c++;
                        cout<<r<<" "<<i<<" ";
                    }
                    cout<<endl;
                    k--;

                }
                else
                {
                    cout<<2<<" ";
                    for(int i=0 ; i<2 ; i++)
                    {
                        cout<<r<<" "<<c<<" ";
                        r++;
                    }
                    cout<<endl;
                    r--;
                    k--;
                    c--;
                    state=1;
                }
            }
            else
            {
                if(c!=1)
                {
                    cout<<2<<" ";
                    int k1=c;
                    for(int i=k1 ; i>k1-2 ; i--)
                    {
                        cout<<r<<" "<<i<<" ";
                        c--;
                    }
                    cout<<endl;
                    if(c==0)
                    {
                        c++,r++,state=0;
                    }
                    k--;
                }
                else
                {
                    r++;
                    state=0;
                }
            }
        }
        else
        {
            //cout<<k<<endl;
            //cout<<r<<" "<<c<<endl;
            vector<pair<int,int> >v;
            int s1;
            if(state==0)
            {
                s1=0;
            }
            else
            {
                s1=1;
            }
            while(r!=n+1)
            {

                if(s1==0)
                {
                    for(int j=c ; j<=m ; j++)
                    {
                        //cout<<r<<" "<<j<<" ";
                        v.push_back({r,j});
                        c++;
                    }
                    r++;
                    s1=1;
                    c=m;
                }
                else
                {
                    for(int j=c ; j>=1 ; j--)
                    {
                        v.push_back({r,j});
                        //cout<<r<<" "<<j<<" ";
                    }
                    c=1;
                    r++;
                    s1=0;
                }
            }
            cout<<v.size()<<" ";
            for(int i=0 ; i<v.size() ; i++)
            {
                cout<<v[i].first<<" "<<v[i].second<<" ";
            }
            cout<<endl;
            k--;
            break;
        }
    }

}


#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mkp make_pair
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define ff first
#define ss second
#define endl "\n"
#define MOD 1000000007
#define MOD1 998244353

ll GCD(ll x,ll y){if(y==0)return x;return GCD(y,x%y);}
ll LCM(ll x,ll y){return (x*y)/(GCD(x,y));}
ll LOGK(ll x,ll k){if(x>=k)return 1+LOGK(x/k,k);return 0;}
ll MPOW( ll a, ll b, ll m) { if(b==0) return 1; ll x=MPOW(a,b/2,m); x=(x*x)%m; if(b%2==1) x=(x*a)%m; return x;}
ll MINV(ll a,ll m) {return MPOW(a,m-2,m);}

class pnc{
  ll FACT_MAX,MODU;
  vector<ll> fact;
public:
  pnc( ll n, ll m) { FACT_MAX = n; fact.resize(FACT_MAX); MODU = m; MFACT_INIT(MODU);}
  void MFACT_INIT( ll m) { fact[0]=1; for(ll i=1;i<FACT_MAX;++i) fact[i]=(i*fact[i-1])%MODU;}
  ll MFACT( ll n) { return fact[n];}
  ll PERM( ll n, ll r) { return (fact[n]*::MINV(fact[n-r],MODU))%MODU;}
  ll COMB( ll n , ll r) { return (PERM(n,r)*::MINV(fact[r],MODU))%MODU;}
};

ll n,m,k;
bool visited[300][300]={false};
ll x=1,y=1;

void dfs(ll x,ll y)
{
    visited[x][y]=true;
    cout<<' '<<x<<' '<<y;

    if(x-1>=1 && !visited[x-1][y])
    dfs(x-1,y);

    if(x+1<=n && !visited[x+1][y])
    dfs(x+1,y);

    if(y-1>=1 && !visited[x][y-1])
    dfs(x,y-1);

    if(y+1<=m && !visited[x][y+1])
    dfs(x,y+1);
}

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

    ll test=1;
    //cin>>test;
    while(test--)
    {
        cin>>n>>m>>k;

        x=1;
        y=1;

        for(ll i=1;i<=k-1;i++)
        {
            if(m%2==1 && x%2==0 && y==m)
            {
                cout<<2<<' '<<x-1<<' '<<m<<' '<<x<<' '<<m<<endl;
                visited[x-1][m]=true;
                visited[x][m]=true;
                x++;
                y=1;
                continue;
            }

            if(y<m)
            {
                cout<<2<<' '<<x<<' '<<y<<' '<<x<<' '<<y+1<<endl;
                visited[x][y]=true;
                visited[x][y+1]=true;
                y+=2;
            }
            else
            {
                y=1;
                x++;
                cout<<2<<' '<<x<<' '<<y<<' '<<x<<' '<<y+1<<endl;
                visited[x][y]=true;
                visited[x][y+1]=true;
                y+=2;
            }

        }

        cout<<n*m-2*(k-1);
        if(y>m)
        {
            y=1;
            x++;
        }

        for(ll i=1;i<=n;i++)
        {
            for(ll j=1;j<=m;j++)
            {
                if(!visited[i][j])
                dfs(i,j);
                break;
            }
        }
    }
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mkp make_pair
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define ff first
#define ss second
#define endl "\n"
#define MOD 1000000007
#define MOD1 998244353

ll GCD(ll x,ll y){if(y==0)return x;return GCD(y,x%y);}
ll LCM(ll x,ll y){return (x*y)/(GCD(x,y));}
ll LOGK(ll x,ll k){if(x>=k)return 1+LOGK(x/k,k);return 0;}
ll MPOW( ll a, ll b, ll m) { if(b==0) return 1; ll x=MPOW(a,b/2,m); x=(x*x)%m; if(b%2==1) x=(x*a)%m; return x;}
ll MINV(ll a,ll m) {return MPOW(a,m-2,m);}

class pnc{
  ll FACT_MAX,MODU;
  vector<ll> fact;
public:
  pnc( ll n, ll m) { FACT_MAX = n; fact.resize(FACT_MAX); MODU = m; MFACT_INIT(MODU);}
  void MFACT_INIT( ll m) { fact[0]=1; for(ll i=1;i<FACT_MAX;++i) fact[i]=(i*fact[i-1])%MODU;}
  ll MFACT( ll n) { return fact[n];}
  ll PERM( ll n, ll r) { return (fact[n]*::MINV(fact[n-r],MODU))%MODU;}
  ll COMB( ll n , ll r) { return (PERM(n,r)*::MINV(fact[r],MODU))%MODU;}
};

ll n,m,k;
bool visited[305][305]={false};
ll x=1,y=1;

void dfs(ll x,ll y)
{
    visited[x][y]=true;
    cout<<' '<<x<<' '<<y;

    if(x+1<=n && !visited[x+1][y])
    dfs(x+1,y);

    if(x-1>=1 && !visited[x-1][y])
    dfs(x-1,y);

    if(y-1>=1 && !visited[x][y-1])
    dfs(x,y-1);

    if(y+1<=m && !visited[x][y+1])
    dfs(x,y+1);
}

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

    ll test=1;
    //cin>>test;
    while(test--)
    {
        cin>>n>>m>>k;

        x=1;
        y=1;

        for(ll i=1;i<=k-1;i++)
        {
            if(m%2==1 && x%2==0 && y==m)
            {
                cout<<2<<' '<<x-1<<' '<<m<<' '<<x<<' '<<m<<endl;
                visited[x-1][m]=true;
                visited[x][m]=true;
                x++;
                y=1;
                continue;
            }

            if(y<m)
            {
                cout<<2<<' '<<x<<' '<<y<<' '<<x<<' '<<y+1<<endl;
                visited[x][y]=true;
                visited[x][y+1]=true;
                y+=2;
            }
            else
            {
                y=1;
                x++;
                cout<<2<<' '<<x<<' '<<y<<' '<<x<<' '<<y+1<<endl;
                visited[x][y]=true;
                visited[x][y+1]=true;
                y+=2;
            }

        }

        cout<<n*m-2*(k-1);
        if(y>m)
        {
            y=1;
            x++;
        }

        for(ll i=1;i<=n;i++)
        {
            if(!visited[i][m])
            {
                dfs(i,m);
                break;
            }
        }
    }
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mkp make_pair
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define ff first
#define ss second
#define endl "\n"
#define MOD 1000000007
#define MOD1 998244353

ll GCD(ll x,ll y){if(y==0)return x;return GCD(y,x%y);}
ll LCM(ll x,ll y){return (x*y)/(GCD(x,y));}
ll LOGK(ll x,ll k){if(x>=k)return 1+LOGK(x/k,k);return 0;}
ll MPOW( ll a, ll b, ll m) { if(b==0) return 1; ll x=MPOW(a,b/2,m); x=(x*x)%m; if(b%2==1) x=(x*a)%m; return x;}
ll MINV(ll a,ll m) {return MPOW(a,m-2,m);}

class pnc{
  ll FACT_MAX,MODU;
  vector<ll> fact;
public:
  pnc( ll n, ll m) { FACT_MAX = n; fact.resize(FACT_MAX); MODU = m; MFACT_INIT(MODU);}
  void MFACT_INIT( ll m) { fact[0]=1; for(ll i=1;i<FACT_MAX;++i) fact[i]=(i*fact[i-1])%MODU;}
  ll MFACT( ll n) { return fact[n];}
  ll PERM( ll n, ll r) { return (fact[n]*::MINV(fact[n-r],MODU))%MODU;}
  ll COMB( ll n , ll r) { return (PERM(n,r)*::MINV(fact[r],MODU))%MODU;}
};

ll n,m,k;
bool visited[305][305]={false};
ll x=1,y=1;

void dfs(ll x,ll y)
{
    visited[x][y]=true;
    cout<<' '<<x<<' '<<y;

    if(y-1>=1 && !visited[x][y-1])  //left
    dfs(x,y-1);

    if(y+1<=m && !visited[x][y+1])  //right
    dfs(x,y+1);

    if(x+1<=n && !visited[x+1][y])  //down
    dfs(x+1,y);

    if(x-1>=1 && !visited[x-1][y])  //up
    dfs(x-1,y);
}

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

    ll test=1;
    //cin>>test;
    while(test--)
    {
        cin>>n>>m>>k;

        x=1;
        y=1;

        // for(ll i=1;i<=k-1;i++)
        // {
        //     if(m%2==1 && x%2==0 && y==m)
        //     {
        //         cout<<2<<' '<<x-1<<' '<<m<<' '<<x<<' '<<m<<endl;
        //         visited[x-1][m]=true;
        //         visited[x][m]=true;
        //         x++;
        //         y=1;
        //         continue;
        //     }

        //     if(y<m)
        //     {
        //         cout<<2<<' '<<x<<' '<<y<<' '<<x<<' '<<y+1<<endl;
        //         visited[x][y]=true;
        //         visited[x][y+1]=true;
        //         y+=2;
        //     }
        //     else
        //     {
        //         y=1;
        //         x++;
        //         cout<<2<<' '<<x<<' '<<y<<' '<<x<<' '<<y+1<<endl;
        //         visited[x][y]=true;
        //         visited[x][y+1]=true;
        //         y+=2;
        //     }

        // }

        if(m%2==1)
        {
            ll flag=0;

            for(ll i=1;i<=k-1;i++)
            {
                if(y<m)
                {
                    if(flag==0)
                    {
                        cout<<2<<' '<<x<<' '<<y<<' '<<x<<' '<<y+1<<endl;
                        visited[x][y]=true;
                        visited[x][y+1]=true;
                        y+=2;
                    }
                    else
                    {
                        cout<<2<<' '<<x<<' '<<y<<' '<<x<<' '<<y+1<<endl;
                        visited[x][y]=true;
                        visited[x][y+1]=true;
                        y-=2;
                        if(y<1)
                        {
                            y=1;
                            flag=0;
                            x++;
                        }
                    }

                }
                else if(y==m)
                {
                    cout<<2<<' '<<x<<' '<<m<<' '<<x+1<<' '<<m<<endl;
                    visited[x][m]=true;
                    visited[x+1][m]=true;
                    x++;
                    y=m;
                    y-=2;
                    flag=1;
                }
            }
            cout<<n*m-2*(k-1);

            if(y<1)
            {
                y=1;
                x++;
            }

            if(y<m && flag==1)
            y++;

            dfs(x,y);
        }
        else
        {
            for(ll i=1;i<=k-1;i++)
            {
                if(y<m)
                {
                    cout<<2<<' '<<x<<' '<<y<<' '<<x<<' '<<y+1<<endl;
                    visited[x][y]=true;
                    visited[x][y+1]=true;
                    y+=2;
                }
                else
                {
                    y=1;
                    x++;
                    cout<<2<<' '<<x<<' '<<y<<' '<<x<<' '<<y+1<<endl;
                    visited[x][y]=true;
                    visited[x][y+1]=true;
                    y+=2;
                }

            }

            cout<<n*m-2*(k-1);
            if(y>m)
            {
                y=1;
                x++;
            }
            dfs(x,y);
        }

    }
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mkp make_pair
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define ff first
#define ss second
#define endl "\n"
#define MOD 1000000007
#define MOD1 998244353

ll GCD(ll x,ll y){if(y==0)return x;return GCD(y,x%y);}
ll LCM(ll x,ll y){return (x*y)/(GCD(x,y));}
ll LOGK(ll x,ll k){if(x>=k)return 1+LOGK(x/k,k);return 0;}
ll MPOW( ll a, ll b, ll m) { if(b==0) return 1; ll x=MPOW(a,b/2,m); x=(x*x)%m; if(b%2==1) x=(x*a)%m; return x;}
ll MINV(ll a,ll m) {return MPOW(a,m-2,m);}

class pnc{
  ll FACT_MAX,MODU;
  vector<ll> fact;
public:
  pnc( ll n, ll m) { FACT_MAX = n; fact.resize(FACT_MAX); MODU = m; MFACT_INIT(MODU);}
  void MFACT_INIT( ll m) { fact[0]=1; for(ll i=1;i<FACT_MAX;++i) fact[i]=(i*fact[i-1])%MODU;}
  ll MFACT( ll n) { return fact[n];}
  ll PERM( ll n, ll r) { return (fact[n]*::MINV(fact[n-r],MODU))%MODU;}
  ll COMB( ll n , ll r) { return (PERM(n,r)*::MINV(fact[r],MODU))%MODU;}
};

ll n,m,k;
bool visited[300][300]={false};
ll x=1,y=1;

void dfs(ll x,ll y)
{
    visited[x][y]=true;
    cout<<' '<<x<<' '<<y;

    if(x-1>=1 && !visited[x-1][y])
    dfs(x-1,y);

    if(x+1<=n && !visited[x+1][y])
    dfs(x+1,y);

    if(y-1>=1 && !visited[x][y-1])
    dfs(x,y-1);

    if(y+1<=m && !visited[x][y+1])
    dfs(x,y+1);
}

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

    ll test=1;
    //cin>>test;
    while(test--)
    {
        cin>>n>>m>>k;

        x=1;
        y=1;

        for(ll i=1;i<=k-1;i++)
        {
            if(y<=m)
            {
                cout<<1<<' '<<x<<' '<<y<<endl;
                visited[x][y]=true;
                y++;
            }
            else
            {
                y=1;
                x++;
                cout<<1<<' '<<x<<' '<<y<<endl;
                visited[x][y]=true;
                y++;
            }

        }

        cout<<n*m-(k-1);
        if(y>m)
        {
            y=1;
            x++;
        }

        dfs(x,y);
    }
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mkp make_pair
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define ff first
#define ss second
#define endl "\n"
#define MOD 1000000007
#define MOD1 998244353

ll GCD(ll x,ll y){if(y==0)return x;return GCD(y,x%y);}
ll LCM(ll x,ll y){return (x*y)/(GCD(x,y));}
ll LOGK(ll x,ll k){if(x>=k)return 1+LOGK(x/k,k);return 0;}
ll MPOW( ll a, ll b, ll m) { if(b==0) return 1; ll x=MPOW(a,b/2,m); x=(x*x)%m; if(b%2==1) x=(x*a)%m; return x;}
ll MINV(ll a,ll m) {return MPOW(a,m-2,m);}

class pnc{
  ll FACT_MAX,MODU;
  vector<ll> fact;
public:
  pnc( ll n, ll m) { FACT_MAX = n; fact.resize(FACT_MAX); MODU = m; MFACT_INIT(MODU);}
  void MFACT_INIT( ll m) { fact[0]=1; for(ll i=1;i<FACT_MAX;++i) fact[i]=(i*fact[i-1])%MODU;}
  ll MFACT( ll n) { return fact[n];}
  ll PERM( ll n, ll r) { return (fact[n]*::MINV(fact[n-r],MODU))%MODU;}
  ll COMB( ll n , ll r) { return (PERM(n,r)*::MINV(fact[r],MODU))%MODU;}
};

ll n,m,k;
bool visited[305][305]={false};
ll x=1,y=1;

void dfs(ll x,ll y)
{
    visited[x][y]=true;
    cout<<' '<<x<<' '<<y;

    if(x-1>=1 && !visited[x-1][y])
    dfs(x-1,y);

    if(x+1<=n && !visited[x+1][y])
    dfs(x+1,y);

    if(y-1>=1 && !visited[x][y-1])
    dfs(x,y-1);

    if(y+1<=m && !visited[x][y+1])
    dfs(x,y+1);
}

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

    ll test=1;
    //cin>>test;
    while(test--)
    {
        cin>>n>>m>>k;

        x=1;
        y=1;

        for(ll i=1;i<=k-1;i++)
        {
            if(m%2==1 && x%2==0 && y==m)
            {
                cout<<2<<' '<<x-1<<' '<<m<<' '<<x<<' '<<m<<endl;
                visited[x-1][m]=true;
                visited[x][m]=true;
                x++;
                y=1;
                continue;
            }

            if(y<m)
            {
                cout<<2<<' '<<x<<' '<<y<<' '<<x<<' '<<y+1<<endl;
                visited[x][y]=true;
                visited[x][y+1]=true;
                y+=2;
            }
            else
            {
                y=1;
                x++;
                cout<<2<<' '<<x<<' '<<y<<' '<<x<<' '<<y+1<<endl;
                visited[x][y]=true;
                visited[x][y+1]=true;
                y+=2;
            }

        }

        cout<<n*m-2*(k-1);
        if(y>m)
        {
            y=1;
            x++;
        }

        for(ll i=1;i<=n;i++)
        {
            for(ll j=1;j<=m;j++)
            {
                if(!visited[i][j])
                dfs(i,j);
                break;
            }
        }
    }
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mkp make_pair
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define ff first
#define ss second
#define endl "\n"
#define MOD 1000000007
#define MOD1 998244353

ll GCD(ll x,ll y){if(y==0)return x;return GCD(y,x%y);}
ll LCM(ll x,ll y){return (x*y)/(GCD(x,y));}
ll LOGK(ll x,ll k){if(x>=k)return 1+LOGK(x/k,k);return 0;}
ll MPOW( ll a, ll b, ll m) { if(b==0) return 1; ll x=MPOW(a,b/2,m); x=(x*x)%m; if(b%2==1) x=(x*a)%m; return x;}
ll MINV(ll a,ll m) {return MPOW(a,m-2,m);}

class pnc{
  ll FACT_MAX,MODU;
  vector<ll> fact;
public:
  pnc( ll n, ll m) { FACT_MAX = n; fact.resize(FACT_MAX); MODU = m; MFACT_INIT(MODU);}
  void MFACT_INIT( ll m) { fact[0]=1; for(ll i=1;i<FACT_MAX;++i) fact[i]=(i*fact[i-1])%MODU;}
  ll MFACT( ll n) { return fact[n];}
  ll PERM( ll n, ll r) { return (fact[n]*::MINV(fact[n-r],MODU))%MODU;}
  ll COMB( ll n , ll r) { return (PERM(n,r)*::MINV(fact[r],MODU))%MODU;}
};

ll n,m,k;
bool visited[300][300]={false};
ll x=1,y=1;

void dfs(ll x,ll y)
{
    visited[x][y]=true;
    cout<<' '<<x<<' '<<y;

    if(x-1>=1 && !visited[x-1][y])
    dfs(x-1,y);

    if(x+1<=n && !visited[x+1][y])
    dfs(x+1,y);

    if(y-1>=1 && !visited[x][y-1])
    dfs(x,y-1);

    if(y+1<=m && !visited[x][y+1])
    dfs(x,y+1);
}

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

    ll test=1;
    //cin>>test;
    while(test--)
    {
        cin>>n>>m>>k;

        x=1;
        y=1;

        for(ll i=1;i<=k-1;i++)
        {
            if(y<m)
            {
                cout<<2<<' '<<x<<' '<<y<<' '<<x<<' '<<y+1<<endl;
                visited[x][y]=true;
                visited[x][y+1]=true;
                y+=2;
            }
            else
            {
                y=1;
                x++;
                cout<<2<<' '<<x<<' '<<y<<' '<<x<<' '<<y+1<<endl;
                visited[x][y]=true;
                visited[x][y+1]=true;
                y+=2;
            }

        }

        cout<<n*m-2*(k-1);
        if(y>m)
        {
            y=1;
            x++;
        }

        dfs(x,y);
    }
}


#include<iostream>
using namespace std;

int main(){
	int n,m,k;
	cin>>n>>m>>k;
	int total = n*m;
	int each = total/k;
	int last = each + total%k;
	int count=0;
	int l=k;
	for(int i=0;i<n;i++){
		if(i%2==0){
			for(int j=0;j<m;j++){
				if(l>1){
					label:
					if(count==0){
						cout<<each<<" ";
					}else if(count==each){
						cout<<endl;
						count=0;
						l--;
						goto label;
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}else if(l==1){
					if(count==0){
						cout<<last<<" ";
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}
			}
		}else{
			for(int j=m-1;j>=0;j--){
				if(l>1){
					label2:
					if(count==0){
						cout<<each<<" ";
					}else if(count==each){
						cout<<endl;
						count=0;
						l--;
						goto label2;
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}else if(l==1){
					if(count==0){
						cout<<last<<" ";
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}
			}
		}
	}

	return 0;
}


#include<iostream>
using namespace std;

int main(){
	int n,m,k;
	cin>>n>>m>>k;
	int total = n*m;
	int each = total/k;
	int last = each + total%k;
	int count=0;
	int l=k;
	cout<<last<<endl<<endl<<endl;
	for(int i=0;i<n;i++){
		if(i%2==0){
			for(int j=0;j<m;j++){
				label:
				if(l>1){
					if(count==0){
						cout<<each<<" ";
					}else if(count==each){
						cout<<endl;
						count=0;
						l--;
						goto label;
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}else if(l==1){
					if(count==0){
						//cout<<endl<<"check2"<<endl;
						cout<<last<<" ";
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}
			}
		}else{
			for(int j=m-1;j>=0;j--){
				label2:
				if(l>1){
					if(count==0){
						cout<<each<<" ";
					}else if(count==each){
						cout<<endl;
						count=0;
						l--;
						goto label2;
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}else if(l==1){
					if(count==0){
						//cout<<endl<<"check2"<<endl;
						cout<<last<<" ";
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}
			}
		}
	}

	return 0;
}


#include<iostream>
using namespace std;

int main(){
	int n,m,k;
	cin>>n>>m>>k;
	int total = n*m;
	int each = total/k;
	int last = each + total%k;
	int count=0;
	int l=k;
	for(int i=0;i<n;i++){
		if(i%2==0){
			for(int j=0;j<m;j++){
				if(l>1){
					label:
					if(count==0){
						cout<<each<<" ";
					}else if(count==each){
						cout<<endl;
						count=0;
						goto label;
						l--;
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}else if(l==1){
					if(count==0){
						cout<<each<<" ";
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}
			}
		}else{
			for(int j=m-1;j>=0;j--){
				if(l>1){
					label2:
					if(count==0){
						cout<<each<<" ";
					}else if(count==each){
						cout<<endl;
						count=0;
						goto label2;
						l--;
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}else if(l==1){
					if(count==0){
						cout<<each<<" ";
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}
			}
		}
	}

	return 0;
}


#include<iostream>
using namespace std;

int main(){
	int n,m,k;
	cin>>n>>m>>k;
	int total = n*m;
	int each = total/k;
	int last = each + total%k;
	int count=0;
	int l=k;
	for(int i=0;i<n;i++){
		if(i%2==0){
			for(int j=0;j<m;j++){
				if(l>1){
					label:
					if(count==0){
						cout<<each<<" ";
					}else if(count==each){
						cout<<endl;
						count=0;
						l--;
						goto label;
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}else if(l==1){
					if(count==0){
						cout<<each<<" ";
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}
			}
		}else{
			for(int j=m-1;j>=0;j--){
				if(l>1){
					label2:
					if(count==0){
						cout<<each<<" ";
					}else if(count==each){
						cout<<endl;
						count=0;
						l--;
						goto label2;
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}else if(l==1){
					if(count==0){
						cout<<each<<" ";
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}
			}
		}
	}

	return 0;
}


#include<iostream>
using namespace std;

int main(){
	int n,m,k;
	cin>>n>>m>>k;
	int total = n*m;
	int each = total/k;
	int last = each + total%k;
	int count=0;
	int l=k;
	//cout<<last<<endl<<endl<<endl;
	for(int i=0;i<n;i++){
		if(i%2==0){
			for(int j=0;j<m;j++){
				label:
				if(l>1){
					if(count==0){
						cout<<each<<" ";
					}else if(count==each){
						cout<<endl;
						count=0;
						l--;
						goto label;
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}else if(l==1){
					if(count==0){
						//cout<<endl<<"check2"<<endl;
						cout<<last<<" ";
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}
			}
		}else{
			for(int j=m-1;j>=0;j--){
				label2:
				if(l>1){
					if(count==0){
						cout<<each<<" ";
					}else if(count==each){
						cout<<endl;
						count=0;
						l--;
						goto label2;
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}else if(l==1){
					if(count==0){
						//cout<<endl<<"check2"<<endl;
						cout<<last<<" ";
					}
					count++;
					cout<<i+1<<" "<<j+1<<" ";
				}
			}
		}
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int n , m , k ;
vector<ll>ve , ve2;
vector<pair<int,int>>ans(300*300);
int arr[202][202];
int main(){
   scanf("%d%d%d",&n,&m,&k);
   int a = 1 ;
    int coun = 0;
   for(int i = 1 ; i <= n ; ++i){
        if(i%2!=0){
       for(int j = 1 ; j <= m ; ++j){
            arr[i][j]=a;
               coun++;
               if(coun == 2 && a == k)
                   coun = 0;
               else if(coun==2){
                 a++;
                 coun = 0;
               }
        }
      }else{
        for(int j = m ; j >=1 ; --j){
          arr[i][j]=a;
             coun++;
               if(coun == 2 && a == k)
                   coun = 0;
               else if(coun==2){
                 a++;
                 coun = 0;
               }
        }
      }
   }
   int pos = 1 , pos2 = 1;
     for(int i = 1 ; i <= k-1 ; ++i ){
         if(i!=k)
          printf("2 ");
          bool f = 0;
          for(int i1 = pos ; i1 <= n ; ++i1){
             if(i1%2!=0){
                for(int j = pos2 ; j <= m ; ++j){
                    if(arr[i1][j]==i)
                  cout<<i1<<" "<<j<<" ";
                  else{
                    pos = i1;
                    pos2 = j;
                    f = 1;
                    cout<<endl;
                    break;
                  }
                }
                if(f)
                break;
          }else{
                for(int j = pos2 ; j >= 0 ; --j){
                    if(arr[i1][j]==i)
                  cout<<i1<<" "<<j<<" ";
                  else{
                    pos = i1;
                    pos2 = j;
                    f = 1;
                    cout<<endl;
                    break;
                  }
                }
                if(f)
                break;
          }
      }
     }
     if(pos%2!=0){
     cout<<(n*m)-((k-1)*2)<<" ";
      for(int i = pos2 ; i <= m ; ++i){
          if(arr[pos][i]==k)
            cout<<pos<<" "<<i<<" ";
      }
      pos++;
     for(int i = pos ; i <= n  ; ++i){
          if(i%2!=0){
        for(int j = 1 ; j<= m ; ++j)
            if(arr[i][j]==k)
              cout<<i<<" "<<j<<" ";
     }
    else{
        for(int j = m ; j>=1 ; --j){
            if(arr[i][j]==k)
               cout<<i<<" "<<j<<" ";
        }
    }
}
}else{

     cout<<(n*m)-((k-1)*2)<<" ";
      for(int i = pos2 ; i>=1 ; --i){
          if(arr[pos][i]==k)
            cout<<pos<<" "<<i<<" ";
      }
      pos++;
     for(int i = pos ; i <= n  ; ++i){
          if(i%2!=0){
        for(int j = 1 ; j<= m ; ++j)
            if(arr[i][j]==k)
              cout<<i<<" "<<j<<" ";
     }
    else{
        for(int j = m ; j>=1 ; --j){
            if(arr[i][j]==k)
               cout<<i<<" "<<j<<" ";
        }
    }

}
}
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int n , m , k , lx = 1 , ly = 1 ;
bool fla=true;
int arr[301][301];
void clac(int &x , int &y , int con , int num , bool &f)
{
   if(num == con)
   return;
   printf("%d %d ",x,y);
   if(!f) {
        if(x == 1)
      clac(x , ++y , con , num+1 , fla=!f);
      else
      clac(--x , y , con , num+1 , f);
   }
   else{
       if(x == n)
      clac(x , ++y , con , num+1 , fla=!f);
      else
      clac(++x, y , con , num+1 , f);

   }
}
int main() {
   scanf("%d%d%d", &n , &m , &k);
   while(--k)
   {
      printf("%d ",2);
      clac(lx , ly, 2 , 0, fla);
      printf("\n");
   }
   cout<< (n*m)-((k-1)*2)<<" ";
   clac(lx , ly, (n*m)-((k-1)*2) , 0 , fla);
   return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int n , m , k ;
vector<ll>ve , ve2;
vector<pair<int,int>>ans(300*300);
int arr[202][202];
int main(){
   scanf("%d%d%d",&n,&m,&k);
   int a = 1 ;
    int coun = 0;
   for(int i = 1 ; i <= n ; ++i){
        if(i%2!=0){
       for(int j = 1 ; j <= m ; ++j){
            arr[i][j]=a;
               coun++;
               if(coun == 2 && a == k)
                   coun = 0;
               else if(coun==2){
                 a++;
                 coun = 0;
               }
        }
      }else{
        for(int j = m ; j >=1 ; --j){
          arr[i][j]=a;
             coun++;
               if(coun == 2 && a == k)
                   coun = 0;
               else if(coun==2){
                 a++;
                 coun = 0;
               }
        }
      }
   }
   int pos = 1 , pos2 = 1;
     for(int i = 1 ; i <= k-1 ; ++i ){
         if(i!=k)
          printf("2 ");
          bool f = 0;
          for(int i1 = pos ; i1 <= n ; ++i1){
             if(i1%2!=0){
                for(int j = pos2 ; j <= m ; ++j){
                    if(arr[i1][j]==i)
                  cout<<i1<<" "<<j<<" ";
                  else{
                    pos = i1;
                    pos2 = j;
                    f = 1;
                    cout<<endl;
                    break;
                  }
                }
                if(f)
                break;
          }else{
                for(int j = pos2 ; j >= 0 ; --j){
                    if(arr[i1][j]==i)
                  cout<<i1<<" "<<j<<" ";
                  else{
                    pos = i1;
                    pos2 = j;
                    f = 1;
                    cout<<endl;
                    break;
                  }
                }
                if(f)
                break;
          }
      }
     }
     cout<<(n*m)-((k-1)*2)<<" ";
     for(int i = pos ; i <= n  ; ++i)
        for(int j = 1 ; j<= m ; ++j)
            if(arr[i][j]==k)
              cout<<i<<" "<<j<<" ";

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int n , m , k , lx = 1 , ly = 1 ;
bool fla=true;
int arr[301][301];
void clac(int &x , int &y , int con , int num , bool &f)
{
   if(num == con)
   return;
   printf("%d %d ",x,y);
   if(!f) {
        if(x == 1)
      clac(x , ++y , con , num+1 , fla=!f);
      else
      clac(--x , y , con , num+1 , f);
   }
   else{
       if(x == n)
      clac(x , ++y , con , num+1 , fla=!f);
      else
      clac(++x, y , con , num+1 , f);

   }
}
int main() {
   scanf("%d%d%d", &n , &m , &k);
   int k1=k;
   while(--k)
   {
      printf("%d ",2);
      clac(lx , ly, 2 , 0, fla);
      printf("\n");
   }
   cout<< (n*m)-((k1-1)*2)<<" ";
   clac(lx , ly, (n*m)-((k1-1)*2) , 0 , fla);
   return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int n , m , k ;
vector<ll>ve , ve2;
vector<pair<int,int>>ans(300*300);
int arr[301][301];
int main(){
   scanf("%d%d%d",&n,&m,&k);
   int a = 1 ;
    int coun = 0;
   for(int i = 1 ; i <= n ; ++i){
        if(i%2!=0){
       for(int j = 1 ; j <= m ; ++j){
            arr[i][j]=a;
               coun++;
               if(coun == 2 && a == k)
                   coun = 0;
               else if(coun==2){
                 a++;
                 coun = 0;
               }
        }
      }else{
        for(int j = m ; j >=1 ; --j){
          arr[i][j]=a;
             coun++;
               if(coun == 2 && a == k)
                   coun = 0;
               else if(coun==2){
                 a++;
                 coun = 0;
               }
        }
      }
   }
   int pos = 1 , pos2 = 1;
     for(int i = 1 ; i <= k-1 ; ++i ){
         if(i!=k)
          printf("2 ");
          bool f = 0;
          for(int i1 = pos ; i1 <= n ; ++i1){
             if(i1%2!=0){
                for(int j = pos2 ; j <= m ; ++j){
                    if(arr[i1][j]==i)
                  cout<<i1<<" "<<j<<" ";
                  else{
                    pos = i1;
                    pos2 = j;
                    f = 1;
                    cout<<endl;
                    break;
                  }
                }
                if(f)
                break;
          }else{
                for(int j = pos2 ; j >= 0 ; --j){
                    if(arr[i1][j]==i)
                  cout<<i1<<" "<<j<<" ";
                  else{
                    pos = i1;
                    pos2 = j;
                    f = 1;
                    cout<<endl;
                    break;
                  }
                }
                if(f)
                break;
          }
      }
     }
     if(pos%2!=0){
     cout<<(n*m)-((k-1)*2)<<" ";
      for(int i = pos2 ; i <= m ; ++i){
          if(arr[pos][i]==k)
            cout<<pos<<" "<<i<<" ";
      }
      if(pos+1<=n){
      pos++;
     for(int i = pos ; i <= n  ; ++i){
          if(i%2!=0){
        for(int j = 1 ; j<= m ; ++j)
            if(arr[i][j]==k)
              cout<<i<<" "<<j<<" ";
     }
    else{
        for(int j = m ; j>=1 ; --j){
            if(arr[i][j]==k)
               cout<<i<<" "<<j<<" ";
        }
    }
}
}
}else{

     cout<<(n*m)-((k-1)*2)<<" ";
      for(int i = pos2 ; i>=1 ; --i){
          if(arr[pos][i]==k)
            cout<<pos<<" "<<i<<" ";
      }
      if(pos+1<=m){
      pos++;
     for(int i = pos ; i <= n  ; ++i){
          if(i%2!=0){
        for(int j = 1 ; j<= m ; ++j)
            if(arr[i][j]==k)
              cout<<i<<" "<<j<<" ";
     }
    else{
        for(int j = m ; j>=1 ; --j){
            if(arr[i][j]==k)
               cout<<i<<" "<<j<<" ";
        }
    }

}
}
}
  return 0;

}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define dbg puts("It's Just Begining.Wait For The End!!!!!\n")
#define CHECK(x) cout << (#x) << " is " << (x) <<"\n";
#define endl printf("\n")
typedef pair<ll,ll> pii;
#define pb push_back
#define ms(a,b) memset(a, b, sizeof(a))
#define in(x) scanf("%lld",&x)
#define out(x) printf("%lld",x)
#define sps printf(" ");
#define X first
#define Y second
#define dou(x) cout<<fixed<<setprecision(6)<<x
bool visit[305][305];
vector<pii>adj[305];
bool valid(ll r,ll c,ll n,ll m)
{
    if(r>0&&r<=n&&c>0&&c<=m&&!visit[r][c])return true;
    else return false;
}
int main()
{
    ll n,m,k,i,j,l;
    in(n);in(m);in(k);
    l=k;
    ms(visit,false);
    k--;
    ll cell=n*m;
    ll indx=1,indy=0;
    ll direction=1;
    for(;cell>2*k;)
    {
        if(indy+direction>m||indy+direction<1)
        {
            if(direction==1)direction=-1;
            else direction=1;
            indx++;
//            cout<<indx<<" FUCK OFF"<<indy;endl;
             if(valid(indx,indy,n,m))
            visit[indx][indy]=true,adj[(ll)1].pb({indx,indy});
            cell--;
        }
        else if(valid(indx,indy+direction,n,m)){
            indy+=direction,visit[indx][indy]=true,adj[(ll)1].pb({indx,indy}),cell--;}
    }
    for(i=2,j=1;cell;i++)
    {
        if(!(i&1))j++;
        if(indy+direction>m||indy+direction<1)
        {
            if(direction==1)direction=-1;
            else direction=1;
            indx++;
//            cout<<indx<<" FUCK OFF"<<indy;endl;
             if(valid(indx,indy,n,m))
            visit[indx][indy]=true,adj[j].pb({indx,indy});
            cell--;
        }
        else if(valid(indx,indy+direction,n,m)){
            indy+=direction,visit[indx][indy]=true,adj[j].pb({indx,indy}),cell--;
//            cout<<indx<<" "<<indy<<"\n";
        }
    }
    for(i=1;i<=l;i++)
    {
        cout<<adj[i].size();sps;
        for(j=0;j<adj[i].size();j++)
        {
            pii cur=adj[i][j];
            out(cur.X);sps;out(cur.Y);sps;
        }
        endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define dbg puts("It's Just Begining.Wait For The End!!!!!\n")
#define CHECK(x) cout << (#x) << " is " << (x) <<"\n";
#define endl printf("\n")
typedef pair<ll,ll> pii;
#define pb push_back
#define ms(a,b) memset(a, b, sizeof(a))
#define in(x) scanf("%lld",&x)
#define out(x) printf("%lld",x)
#define sps printf(" ");
#define X first
#define Y second
#define dou(x) cout<<fixed<<setprecision(6)<<x
bool visit[305][305];
vector<pii>adj[305];
bool valid(ll r,ll c,ll n,ll m)
{
    if(r>0&&r<=n&&c>0&&c<=m&&!visit[r][c])return true;
    else return false;
}
int main()
{
    ll n,m,k,i,j,l;
    in(n);in(m);in(k);
    l=k;
    ms(visit,false);
    k--;
    ll cell=n*m;
    ll indx=1,indy=0;
    ll direction=1;
    for(;cell>k;)
    {
        if(indy+direction>m||indy+direction<1)
        {
            if(direction==1)direction=-1;
            else direction=1;
            indx++;
//            cout<<indx<<" FUCK OFF"<<indy;endl;
             if(valid(indx,indy,n,m))
            visit[indx][indy]=true,adj[(ll)1].pb({indx,indy});
            cell--;
        }
        else if(valid(indx,indy+direction,n,m)){
            indy+=direction,visit[indx][indy]=true,adj[(ll)1].pb({indx,indy}),cell--;}
    }
    for(i=2;cell;i++)
    {
        if(indy+direction>m||indy+direction<1)
        {
            if(direction==1)direction=-1;
            else direction=1;
            indx++;
//            cout<<indx<<" FUCK OFF"<<indy;endl;
             if(valid(indx,indy,n,m))
            visit[indx][indy]=true,adj[i].pb({indx,indy});
            cell--;
        }
        else if(valid(indx,indy+direction,n,m)){
            indy+=direction,visit[indx][indy]=true,adj[i].pb({indx,indy}),cell--;
//            cout<<indx<<" "<<indy<<"\n";
        }
    }
    for(i=1;i<=l;i++)
    {
        out(i);sps;
        for(j=0;j<adj[i].size();j++)
        {
            pii cur=adj[i][j];
            out(cur.X);sps;out(cur.Y);sps;
        }
        endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define dbg puts("It's Just Begining.Wait For The End!!!!!\n")
#define CHECK(x) cout << (#x) << " is " << (x) <<"\n";
#define endl printf("\n")
typedef pair<ll,ll> pii;
#define pb push_back
#define ms(a,b) memset(a, b, sizeof(a))
#define in(x) scanf("%lld",&x)
#define out(x) printf("%lld",x)
#define sps printf(" ");
#define X first
#define Y second
#define dou(x) cout<<fixed<<setprecision(6)<<x
bool visit[305][305];
vector<pii>adj[100005];
bool valid(ll r,ll c,ll n,ll m)
{
    if(r>0&&r<=n&&c>0&&c<=m&&!visit[r][c])return true;
    else return false;
}
int main()
{
    ll n,m,k,i,j,l;
    in(n);in(m);in(k);
    l=k;
    ms(visit,false);
    k--;
    ll cell=n*m;
    ll indx=1,indy=0;
    ll direction=1;
    for(;cell>2*k;)
    {
        if(indy+direction>m||indy+direction<1)
        {
            if(direction==1)direction=-1;
            else direction=1;
            indx++;
//            cout<<indx<<" FUCK OFF"<<indy;endl;
             if(valid(indx,indy,n,m))
            visit[indx][indy]=true,adj[(ll)1].pb({indx,indy});
            cell--;
        }
        else if(valid(indx,indy+direction,n,m)){
            indy+=direction,visit[indx][indy]=true,adj[(ll)1].pb({indx,indy}),cell--;}
    }
    for(i=2,j=1;cell;i++)
    {
        if(!(i&1))j++;
        if(indy+direction>m||indy+direction<1)
        {
            if(direction==1)direction=-1;
            else direction=1;
            indx++;
//            cout<<indx<<" FUCK OFF"<<indy;endl;
//            CHECK(direction);
             if(valid(indx,indy,n,m))
            visit[indx][indy]=true,adj[j].pb({indx,indy});
            cell--;
        }
        else if(valid(indx,indy+direction,n,m)){
            indy+=direction,visit[indx][indy]=true,adj[j].pb({indx,indy}),cell--;
//            cout<<indx<<" "<<indy<<"\n";
        }
    }
    for(i=1;i<=l;i++)
    {
        cout<<adj[i].size();sps;
        for(j=0;j<adj[i].size();j++)
        {
            pii cur=adj[i][j];
            out(cur.X);sps;out(cur.Y);sps;
        }
        endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define dbg puts("It's Just Begining.Wait For The End!!!!!\n")
#define CHECK(x) cout << (#x) << " is " << (x) <<"\n";
#define endl printf("\n")
typedef pair<ll,ll> pii;
#define pb push_back
#define ms(a,b) memset(a, b, sizeof(a))
#define in(x) scanf("%lld",&x)
#define out(x) printf("%lld",x)
#define sps printf(" ");
#define X first
#define Y second
#define dou(x) cout<<fixed<<setprecision(6)<<x
bool visit[305][305];
vector<pii>adj[305];
bool valid(ll r,ll c,ll n,ll m)
{
    if(r>0&&r<=n&&c>0&&c<=m&&!visit[r][c])return true;
    else return false;
}
int main()
{
    ll n,m,k,i,j,l;
    in(n);in(m);in(k);
    l=k;
    ms(visit,false);
    k--;
    ll cell=n*m;
    ll indx=1,indy=0;
    ll direction=1;
    for(;cell>k;)
    {
        if(indy+direction>m||indy+direction<1)
        {
            if(direction==1)direction=-1;
            else direction=1;
            indx++;
//            cout<<indx<<" FUCK OFF"<<indy;endl;
             if(valid(indx,indy,n,m))
            visit[indx][indy]=true,adj[(ll)1].pb({indx,indy});
            cell--;
        }
        else if(valid(indx,indy+direction,n,m)){
            indy+=direction,visit[indx][indy]=true,adj[(ll)1].pb({indx,indy}),cell--;}
    }
    for(i=2;cell;i++)
    {
        if(indy+direction>m||indy+direction<1)
        {
            if(direction==1)direction=-1;
            else direction=1;
            indx++;
//            cout<<indx<<" FUCK OFF"<<indy;endl;
             if(valid(indx,indy,n,m))
            visit[indx][indy]=true,adj[i].pb({indx,indy});
            cell--;
        }
        else if(valid(indx,indy+direction,n,m)){
            indy+=direction,visit[indx][indy]=true,adj[i].pb({indx,indy}),cell--;
//            cout<<indx<<" "<<indy<<"\n";
        }
    }
    for(i=1;i<=l;i++)
    {
        cout<<adj[i].size();sps;
        for(j=0;j<adj[i].size();j++)
        {
            pii cur=adj[i][j];
            out(cur.X);sps;out(cur.Y);sps;
        }
        endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define dbg puts("It's Just Begining.Wait For The End!!!!!\n")
#define CHECK(x) cout << (#x) << " is " << (x) <<"\n";
#define endl printf("\n")
typedef pair<ll,ll> pii;
#define pb push_back
#define ms(a,b) memset(a, b, sizeof(a))
#define in(x) scanf("%lld",&x)
#define out(x) printf("%lld",x)
#define sps printf(" ");
#define X first
#define Y second
#define dou(x) cout<<fixed<<setprecision(6)<<x
bool visit[305][305];
vector<pii>adj[100005];
bool valid(ll r,ll c,ll n,ll m)
{
    if(r>0&&r<=n&&c>0&&c<=m&&!visit[r][c])return true;
    else return false;
}
int main()
{
    ll n,m,k,i,j,l;
    in(n);in(m);in(k);
    l=k;
    ms(visit,false);
    k--;
    ll cell=n*m;
    ll indx=1,indy=0;
    ll direction=1;
    for(;cell>2*k;)
    {
        if(indy+direction>m||indy+direction<1)
        {
            if(direction==1)direction=-1;
            else direction=1;
            indx++;
//            cout<<indx<<" FUCK OFF"<<indy;endl;
             if(valid(indx,indy,n,m))
            visit[indx][indy]=true,adj[(ll)1].pb({indx,indy});
            cell--;
        }
        else if(valid(indx,indy+direction,n,m)){
            indy+=direction,visit[indx][indy]=true,adj[(ll)1].pb({indx,indy}),cell--;}
    }
    for(i=2,j=1;cell;i++)
    {
        if(!(i&1))j++;
        if(indy+direction>m||indy+direction<1)
        {
            if(direction==1)direction=-1;
            else direction=1;
            indx++;
//            cout<<indx<<" FUCK OFF"<<indy;endl;
            CHECK(direction);
             if(valid(indx,indy,n,m))
            visit[indx][indy]=true,adj[j].pb({indx,indy});
            cell--;
        }
        else if(valid(indx,indy+direction,n,m)){
            indy+=direction,visit[indx][indy]=true,adj[j].pb({indx,indy}),cell--;
//            cout<<indx<<" "<<indy<<"\n";
        }
    }
    for(i=1;i<=l;i++)
    {
        cout<<adj[i].size();sps;
        for(j=0;j<adj[i].size();j++)
        {
            pii cur=adj[i][j];
            out(cur.X);sps;out(cur.Y);sps;
        }
        endl;
    }
    return 0;
}


#include <iostream>

int main(void)
{
	unsigned int n, m, k;
	unsigned int* num;
	unsigned int x = 1, y = 1;
	unsigned int i, j;

	std::cin >> n >> m >> k;

	num = new unsigned int[k];

	for (i = 0; i < k; i++)
		num[i] = (n * m + i) / k;

	for (i = 0; i < k; i++)
	{
		std::cout << num[i];

		for (j = 0; j < num[i]; j++)
		{
			std::cout << " " << y << " " << x;

			if (y & 0x1)
			{
				if (x == m)
					y++;
				else
					x++;
			}

			else
			{
				if (x == 1)
					y++;
				else
					x--;
			}
		}

		std::cout << std::endl;
	}

	delete[] num;

	return 0;
}


#include <iostream>
#include <conio.h>

int main(void)
{
	unsigned int n, m, k;
	unsigned int* num;
	unsigned int x = 1, y = 1;
	unsigned int i, j;

	std::cin >> n >> m >> k;

	num = new unsigned int[k];

	for (i = 0; i < k; i++)
		num[i] = (n * m + i) / k;

	for (i = 0; i < k; i++)
	{
		std::cout << num[i];

		for (j = 0; j < num[i]; j++)
		{
			std::cout << " " << y << " " << x;

			if (y & 0x1)
			{
				if (x == m)
					y++;
				else
					x++;
			}

			else
			{
				if (x == 1)
					y++;
				else
					x--;
			}
		}

		std::cout << std::endl;
	}

	delete[] num;

	return 0;
}


#include <iostream>

int main(void)
{
	unsigned int n, m, k, num;
	unsigned int x = 1, y = 1;
	unsigned int i, j;

	std::cin >> n >> m >> k;

	num = n * m / k;

	for (i = 0; i < k; i++)
	{
		std::cout << num;

		for (j = 0; j < num; j++)
		{
			std::cout << " " << x << " " << y;

			if (x & 0x1)
				if (y == n)
					x++;
				else
					y++;
			else
				if (y == 1)
					x++;
				else
					y--;
		}

		std::cout << std::endl;
	}

	return 0;
}


#include <iostream>
#include <conio.h>

int main(void)
{
	unsigned int n, m, k, num;
	unsigned int x = 1, y = 1;
	unsigned int i, j;

	std::cin >> n >> m >> k;

	num = n * m / k;

	for (i = 0; i < k; i++)
	{
		std::cout << num;

		for (j = 0; j < num; j++)
		{
			std::cout << " " << y << " " << x;

			if (y & 0x1)
			{
				if (x == m)
					y++;
				else
					x++;
			}

			else
			{
				if (x == 1)
					y++;
				else
					x--;
			}
		}

		std::cout << std::endl;
	}

	return 0;
}


#include <iostream>

int main(void)
{
	unsigned int n, m, k, num;
	unsigned int x = 1, y = 1;
	unsigned int i, j;

	std::cin >> n >> m >> k;

	num = n * m / k;

	for (i = 0; i < k; i++)
	{
		std::cout << num;

		for (j = 0; j < num; j++)
		{
			std::cout << " " << x << " " << y;

			if (y & 0x1)
				if (x == m)
					y++;
				else
					x++;
			else
				if (x == 1)
					y++;
				else
					x--;
		}

		std::cout << std::endl;
	}

	return 0;
}


#include "bits/stdc++.h"

using namespace std;

#define  f first
#define  lgn 25
#define  endl '\n'
#define  sc second
#define  N (int)1e3+5
#define  sz(x) x.size()
#define  int long long int
#define  ld long double
#define  vi vector<int>
#define  vs vector<string>
#define  vc vector<char>
#define  mii map<int,int>
#define  pii pair<int,int>
#define  vpii vector<pii>
#define  test(x) while(x--)
#define  pb push_back
#define  eb emplace_back
#define  pq priority_queue
#define  mod 1000000007
#define  fo(i,a,n) for(int i=a;i<n;i++)
#define  rfo(i,n,a) for(int i=n;i>=a;i--)
#define  mst(a,v,n) fo(i,0,n) a[i]=v
#define  all(x) begin(x),end(x)
#define  allr(x) rbegin(x),rend(x)
#define  rev(x) reverse(begin(x),end(x))
#define  db(x) cout<<#x <<" : "<< x <<endl;
#define time() cerr << "Time : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n"

const int inf = 0x3f3f3f3f;
const int INF = 0x3f3f3f3f3f3f3f3f;

int n,m,k,q;
string s;
vpii adj[50000];
int vis[N],par[N],a[N][N],sz[N],Q[N];

void go()
{
	cin>>n>>m>>k;

	if( k <= n)
	{
		int x = n - k + 1;

		fo(i,0,k-1)
		{
			cout << m << ' ';
			fo(j,0,m)
			{
				cout << i+1 << ' ' << j + 1 <<' ';
			}
			cout << endl;
		}

		cout << m*x << ' ';

		int toggle = 0;

		fo(i,k,x+k)
		{
			if( toggle == 0 )
			{
				fo(j,0,m)
				{
					cout << i << ' ' << j + 1 <<' ';
				}
			}
			else
			{
				rfo(j,m,1)
				{
					cout << i << ' ' << j <<' ';
				}
			}
			toggle ^= 1;
		}
		cout << endl;
	}
	else
	{
		int total = n*m/2;

		int ok = 0;
		int cn = 1;
		int mm = m;
		if( m&1 ) --mm;
		fo(i,1,n+1)
		{
			fo(j,1,mm+1)
			{
				a[i][j] = cn;
				if( cn != k and j % 2 == 0) ++cn;
			}
		}

		if( m&1 )
		{
			fo(j,0,1)
			{
				fo(i,1,n+1)
				{
					a[i][m] = cn;

					if( i % 2 == 0 and cn != k) ++cn;
				}
			}
		}

		fo(i,1,n+1)
		{
			fo(j,1,m+1)
			{
				adj[ a[i][j] ].pb({i,j});
			}
		}

		fo(i,1,k+1)
		{
			sort(all(adj[i]),  [] (pii a, pii b) -> bool
			{
				if( a.sc == b.sc ) return a.f < b.f;
				return a.sc > b.sc;
			});
			cout << adj[i].size() << ' ';
			for(auto j : adj[i] ) cout << j.f << ' ' << j.sc << ' ';
			cout << endl;
		}
	}
}

int32_t main()
{
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int t=1;
	// cin>>t;
	test(t) go();
}


#include "bits/stdc++.h"

using namespace std;

#define  f first
#define  lgn 25
#define  endl '\n'
#define  sc second
#define  N (int)2e5+5
#define  sz(x) x.size()
#define  int long long int
#define  ld long double
#define  vi vector<int>
#define  vs vector<string>
#define  vc vector<char>
#define  mii map<int,int>
#define  pii pair<int,int>
#define  vpii vector<pii>
#define  test(x) while(x--)
#define  pb push_back
#define  eb emplace_back
#define  pq priority_queue
#define  mod 1000000007
#define  fo(i,a,n) for(int i=a;i<n;i++)
#define  rfo(i,n,a) for(int i=n;i>=a;i--)
#define  mst(a,v,n) fo(i,0,n) a[i]=v
#define  all(x) begin(x),end(x)
#define  allr(x) rbegin(x),rend(x)
#define  rev(x) reverse(begin(x),end(x))
#define  db(x) cout<<#x <<" : "<< x <<endl;
#define time() cerr << "Time : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n"

const int inf = 0x3f3f3f3f;
const int INF = 0x3f3f3f3f3f3f3f3f;

int n,m,k,q;
string s;
vi adj[N];
int vis[N],par[N],a[N],sz[N],Q[N];
vpii v;

void go()
{
	cin>>n>>m>>k;

	fo(i,1,n+1)
	{
		if( i&1 )
		{
			fo(j,1,m+1) v.pb({i,j});
		}
		else
		rfo(j,m+1,1) v.pb({i,j});
	}

	int cur = 0;

	fo(i,1,k+1)
	{
		if( i != k )
		{
			cout << 2 << ' ';
			fo(j,cur + 1 , cur + 3)
			{
				cout << v[j].f << ' ' << v[j].sc << ' ';
			}
			cout << endl;
			cur += 2;
		}
		else
		{
			cout << (n*m) - cur << ' ';

			fo(j,cur + 1, (n*m) + 1)
			{
				cout << v[j].f << ' ' << v[j].sc << ' ';
			}
			cout << endl;
		}

	}

}

int32_t main()
{
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int t=1;
	// cin>>t;
	test(t) go();
}


#include "bits/stdc++.h"

using namespace std;

#define  f first
#define  lgn 25
#define  endl '\n'
#define  sc second
#define  N (int)1e3+5
#define  sz(x) x.size()
#define  int long long int
#define  ld long double
#define  vi vector<int>
#define  vs vector<string>
#define  vc vector<char>
#define  mii map<int,int>
#define  pii pair<int,int>
#define  vpii vector<pii>
#define  test(x) while(x--)
#define  pb push_back
#define  eb emplace_back
#define  pq priority_queue
#define  mod 1000000007
#define  fo(i,a,n) for(int i=a;i<n;i++)
#define  rfo(i,n,a) for(int i=n;i>=a;i--)
#define  mst(a,v,n) fo(i,0,n) a[i]=v
#define  all(x) begin(x),end(x)
#define  allr(x) rbegin(x),rend(x)
#define  rev(x) reverse(begin(x),end(x))
#define  db(x) cout<<#x <<" : "<< x <<endl;
#define time() cerr << "Time : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n"

const int inf = 0x3f3f3f3f;
const int INF = 0x3f3f3f3f3f3f3f3f;

int n,m,k,q;
string s;
vpii adj[N];
int vis[N],par[N],a[N][N],sz[N],Q[N];

void go()
{
	cin>>n>>m>>k;

	if( k <= n)
	{
		int x = n - k + 1;

		fo(i,0,k-1)
		{
			cout << m << ' ';
			fo(j,0,m)
			{
				cout << i+1 << ' ' << j + 1 <<' ';
			}
			cout << endl;
		}

		cout << m*x << ' ';

		int toggle = 0;

		fo(i,k,x+k)
		{
			if( toggle == 0 )
			{
				fo(j,0,m)
				{
					cout << i << ' ' << j + 1 <<' ';
				}
			}
			else
			{
				rfo(j,m,1)
				{
					cout << i << ' ' << j <<' ';
				}
			}
			toggle ^= 1;
		}
		cout << endl;
	}
	else
	{
		int total = n*m/2;

		int ok = 0;
		int cn = 1;
		int mm = m;
		if( m&1 ) --mm;
		fo(i,1,n+1)
		{
			fo(j,1,mm+1)
			{
				a[i][j] = cn;
				if( cn != k and j % 2 == 0) ++cn;
			}
		}

		if( m&1 )
		{
			fo(j,0,1)
			{
				fo(i,1,n+1)
				{
					a[i][m] = cn;

					if( i % 2 == 0 and cn != k) ++cn;
				}
			}
		}

		fo(i,1,n+1)
		{
			fo(j,1,m+1)
			{
				adj[ a[i][j] ].pb({i,j});
			}
		}

		fo(i,1,k+1)
		{
			sort(all(adj[i]),  [] (pii a, pii b) -> bool
			{
				return a.sc > b.sc;
			});
			cout << adj[i].size() << ' ';
			for(auto j : adj[i] ) cout << j.f << ' ' << j.sc << ' ';
			cout << endl;
		}
	}
}

int32_t main()
{
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int t=1;
	// cin>>t;
	test(t) go();
}


#include "bits/stdc++.h"

using namespace std;

#define  f first
#define  lgn 25
#define  endl '\n'
#define  sc second
#define  N (int)2e5+5
#define  sz(x) x.size()
#define  int long long int
#define  ld long double
#define  vi vector<int>
#define  vs vector<string>
#define  vc vector<char>
#define  mii map<int,int>
#define  pii pair<int,int>
#define  vpii vector<pii>
#define  test(x) while(x--)
#define  pb push_back
#define  eb emplace_back
#define  pq priority_queue
#define  mod 1000000007
#define  fo(i,a,n) for(int i=a;i<n;i++)
#define  rfo(i,n,a) for(int i=n;i>=a;i--)
#define  mst(a,v,n) fo(i,0,n) a[i]=v
#define  all(x) begin(x),end(x)
#define  allr(x) rbegin(x),rend(x)
#define  rev(x) reverse(begin(x),end(x))
#define  db(x) cout<<#x <<" : "<< x <<endl;
#define time() cerr << "Time : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n"

const int inf = 0x3f3f3f3f;
const int INF = 0x3f3f3f3f3f3f3f3f;

int n,m,k,q;
string s;
int vis[N],par[N],a[N],sz[N],Q[N];
pii adj[N];

void go()
{
	cin>>n>>m>>k;
	int no = 0;
	fo(i,1,n+1)
	{
		if( i&1 )
		{
			fo(j,1,m+1) adj[ ++no ] = {i,j};
		}
		else
		rfo(j,m,1) adj[ ++no ] = {i,j};
	}

	int cur = 0;

	fo(i,1,k+1)
	{
		if( i != k )
		{
			cout << 2 << ' ';
			fo(j,cur + 1 , cur + 3)
			{
				cout << adj[j].f << ' ' << adj[j].sc << ' ';
			}
			cout << endl;
			cur += 2;
		}
		else
		{
			cout << (n*m) - cur << ' ';

			fo(j,cur + 1, (n*m) + 1)
			{
				cout << adj[j].f << ' ' << adj[j].sc << ' ';
			}
			cout << endl;
		}

	}

}

int32_t main()
{
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int t=1;
	// cin>>t;
	test(t) go();
}


#include "bits/stdc++.h"

using namespace std;

#define  f first
#define  lgn 25
#define  endl '\n'
#define  sc second
#define  N (int)1e3+5
#define  sz(x) x.size()
#define  int long long int
#define  ld long double
#define  vi vector<int>
#define  vs vector<string>
#define  vc vector<char>
#define  mii map<int,int>
#define  pii pair<int,int>
#define  vpii vector<pii>
#define  test(x) while(x--)
#define  pb push_back
#define  eb emplace_back
#define  pq priority_queue
#define  mod 1000000007
#define  fo(i,a,n) for(int i=a;i<n;i++)
#define  rfo(i,n,a) for(int i=n;i>=a;i--)
#define  mst(a,v,n) fo(i,0,n) a[i]=v
#define  all(x) begin(x),end(x)
#define  allr(x) rbegin(x),rend(x)
#define  rev(x) reverse(begin(x),end(x))
#define  db(x) cout<<#x <<" : "<< x <<endl;
#define time() cerr << "Time : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n"

const int inf = 0x3f3f3f3f;
const int INF = 0x3f3f3f3f3f3f3f3f;

int n,m,k,q;
string s;
vpii adj[50000];
int vis[N],par[N],a[N][N],sz[N],Q[N];

void go()
{
	cin>>n>>m>>k;

	if( k <= n)
	{
		int x = n - k + 1;

		fo(i,0,k-1)
		{
			cout << m << ' ';
			fo(j,0,m)
			{
				cout << i+1 << ' ' << j + 1 <<' ';
			}
			cout << endl;
		}

		cout << m*x << ' ';

		int toggle = 0;

		fo(i,k,x+k)
		{
			if( toggle == 0 )
			{
				fo(j,0,m)
				{
					cout << i << ' ' << j + 1 <<' ';
				}
			}
			else
			{
				rfo(j,m,1)
				{
					cout << i << ' ' << j <<' ';
				}
			}
			toggle ^= 1;
		}
		cout << endl;
	}
	else
	{
		int total = n*m/2;

		int ok = 0;
		int cn = 1;
		int mm = m;
		if( m&1 ) --mm;
		fo(i,1,n+1)
		{
			fo(j,1,mm+1)
			{
				a[i][j] = cn;
				if( cn != k and j % 2 == 0) ++cn;
			}
		}

		if( m&1 )
		{
			fo(j,0,1)
			{
				fo(i,1,n+1)
				{
					a[i][m] = cn;

					if( i % 2 == 0 and cn != k) ++cn;
				}
			}
		}

		fo(i,1,n+1)
		{
			fo(j,1,m+1)
			{
				adj[ a[i][j] ].pb({i,j});
			}
		}

		fo(i,1,k+1)
		{
			sort(all(adj[i]),  [] (pii a, pii b) -> bool
			{
				return a.sc > b.sc;
			});
			cout << adj[i].size() << ' ';
			for(auto j : adj[i] ) cout << j.f << ' ' << j.sc << ' ';
			cout << endl;
		}
	}
}

int32_t main()
{
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int t=1;
	// cin>>t;
	test(t) go();
}


#include "bits/stdc++.h"

using namespace std;

#define  f first
#define  lgn 25
#define  endl '\n'
#define  sc second
#define  N (int)2e5+5
#define  sz(x) x.size()
#define  int long long int
#define  ld long double
#define  vi vector<int>
#define  vs vector<string>
#define  vc vector<char>
#define  mii map<int,int>
#define  pii pair<int,int>
#define  vpii vector<pii>
#define  test(x) while(x--)
#define  pb push_back
#define  eb emplace_back
#define  pq priority_queue
#define  mod 1000000007
#define  fo(i,a,n) for(int i=a;i<n;i++)
#define  rfo(i,n,a) for(int i=n;i>=a;i--)
#define  mst(a,v,n) fo(i,0,n) a[i]=v
#define  all(x) begin(x),end(x)
#define  allr(x) rbegin(x),rend(x)
#define  rev(x) reverse(begin(x),end(x))
#define  db(x) cout<<#x <<" : "<< x <<endl;
#define time() cerr << "Time : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n"

const int inf = 0x3f3f3f3f;
const int INF = 0x3f3f3f3f3f3f3f3f;

int n,m,k,q;
string s;
int vis[N],par[N],a[N],sz[N],Q[N];
pii adj[N];

void go()
{
	cin>>n>>m>>k;
	int no = 0;
	fo(i,1,n+1)
	{
		if( i&1 )
		{
			fo(j,1,m+1) adj[ ++no ] = {i,j};
		}
		else
		rfo(j,m,1) adj[ ++no ] = {i,j};
	}

	int cur = 0;

	fo(i,1,k+1)
	{
		if( i != k )
		{
			cout << 2 << ' ';
			fo(j,cur + 1 , cur + 3)
			{
				cout << adj[j].f << ' ' << adj[j].sc << ' ';
			}
			cout << endl;
			cur += 2;
		}
		else
		{
			cout << (no) - cur << ' ';

			fo(j,cur + 1, (no) + 1)
			{
				cout << adj[j].f << ' ' << adj[j].sc << ' ';
			}
			cout << endl;
		}

	}

}

int32_t main()
{
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int t=1;
	// cin>>t;
	test(t) go();
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n,m,k;
	vector<pair<int,int>> v;
	cin >> n >> m >> k;
	for(int i=1;i<=n;i++){
		int dj = (i&1 ? 1 : -1);
		if(i&1){
			for(int j=1;j<=m;j++){
				v.push_back({i,j});
			}
		}else{
			for(int j=m;j>=1;j--){
				v.push_back({i,j});
			}
		}
	}
	int vi=0;
	for(int i=0;i<k-1;i++){
		cout << "2 " << v[vi].first << " " << v[vi].second <<
		" " << v[vi+1].first << " " << v[vi+1].second << "\n";
		vi+=2;
	}
	cout << v.size()-vi << " " << v[vi].first << " " << v[vi].second;
	vi++;
	while(vi < v.size()){
		cout << " " << v[vi].first << " " << v[vi].second;
		vi++;
	}
	cout << "\n";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n,m,k;
	vector<pair<int,int>> v;
	cin >> n >> m >> k;
	for(int i=1;i<=n;i++){
		if(i&1){
			for(int j=1;j<=m;j++){
				v.push_back({i,j});
			}
		}else{
			for(int j=m;j>=1;j--){
				v.push_back({i,j});
			}
		}
	}
	int vi=0;
	for(int i=0;i<k-1;i++){
		cout << "2 " << v[vi].first << " " << v[vi].second <<
		" " << v[vi+1].first << " " << v[vi+1].second << "\n";
		vi+=2;
	}
	cout << v.size()-vi;
	while(vi < v.size()){
		cout << " " << v[vi].first << " " << v[vi].second;
		vi++;
	}
	cout << "\n";
	return 0;
}


using namespace std;
#include<string.h>
#include <sstream>
typedef long long int ll;
typedef long double ld;
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <unordered_map>
#include <map>
//#define N 4
//const ll INF = 0x3f3f3f3f;
//const ll INF = 0x3f3f3f3f3f3f3f3f;
#include <queue>
#include <unordered_set>
#include <math.h>
#include <cstring>
#include <bitset>
#include <numeric>
#include <set>
#include <stack>
#include <sstream>
#include <list>
#include <queue>
#include <sstream>
#define PI 3.14159265358979323846264338327950
#define mp make_pair
#define inf 1e9
#define endl '\n'
#define M 1000000007
//#define N 1000000

int main() {

	ios::sync_with_stdio(0);
	cin.tie(0);

	int n, m, k;
	cin >> n >> m >> k;

	k--;

	int d = 1;
	int c = 2 * k;

	vector<pair<int, int> > ans1, ans2;

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

		if (d == 1) {
			for (int j = 1; j <= m; j++) {

				if (c) {
					ans1.push_back(mp(i, j));
					c--;
				} else {
					ans2.push_back(mp(i, j));
				}
			}
			d = -1;
		} else {
			for (int j = m; j >= 1; j--) {
				if (c) {
					ans1.push_back(mp(i, j));
					c--;
				} else {
					ans2.push_back(mp(i, j));
				}
			}
			d = 1;
		}
	}

	for (int i = 0; i < ans1.size(); i += 2) {
		cout << 2 << " ";
		cout << ans1[i].first << " " << ans1[i].second << " ";
		cout << ans1[i + 1].first << " " << ans1[i + 1].second << " ";
		cout << endl;
	}

	cout << (n * m - (2 * k)) << " ";
	for (int i = 0; i < ans2.size(); i++) {
		cout << ans2[i].first << " " << ans2[i].second << " ";
	}
}


using namespace std;
#include<string.h>
#include <sstream>
typedef long long int ll;
typedef long double ld;
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <unordered_map>
#include <map>
//#define N 4
//const ll INF = 0x3f3f3f3f;
//const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
#include <queue>
#include <unordered_set>
#include <math.h>
#include <cstring>
#include <bitset>
#include <numeric>
#include <set>
#include <sstream>
#include <list>
#include <queue>
#define PI 3.14159265358979323846264338327950
#define mp make_pair
#define inf 1e9
#define M 1000000007
#define N 1000000

int visit[350][350];
int main() {

	ios::sync_with_stdio(0);
	cin.tie(0);

	int n, m, k;
	cin >> n >> m >> k;

	vector<vector<pair<int, int> > > v;
	vector<pair<int, int> > s;
	int c = k - 1;
	int d = 1;

	vector<pair<int, int> > x;
	for (int i = 1; i <= n; i++) {
		if (d == 1) {
			for (int j = 1; j <= m; j++) {
				if (c) {
					x.push_back(mp(i, j));
					if (x.size() == 2) {
						v.push_back(x);
						x.clear();
						c--;
					}
				} else {
					s.push_back(mp(i, j));
				}
			}
			d = -1;
		} else if (d == -1) {
			for (int j = m; j >= 1; j--) {
				if (c) {
					x.push_back(mp(i, j));
					if (x.size() == 2) {
						v.push_back(x);
						x.clear();
						c--;
					}
				} else {
					s.push_back(mp(i, j));
				}
			}
			d = 1;
		}
	}

	for (int i = 0; i < v.size(); i++) {
		cout << v[i].size() << " ";
		for (int j = 0; j < v[i].size(); j++) {
			cout << v[i][j].first << " " << v[i][j].second << " ";
		}
		cout << endl;
	}

	cout << s.size() << " ";
	for (int i = 0; i < s.size(); i++) {
		cout << s[i].first << " " << s[i].second << " ";
	}
}


using namespace std;
#include<string.h>
#include <sstream>
typedef long long int ll;
typedef long double ld;
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <unordered_map>
#include <map>
//#define N 4
//const ll INF = 0x3f3f3f3f;
//const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
#include <queue>
#include <unordered_set>
#include <math.h>
#include <cstring>
#include <bitset>
#include <numeric>
#include <set>
#include <sstream>
#include <list>
#include <queue>
#define PI 3.14159265358979323846264338327950
#define mp make_pair
#define inf 1e9
#define M 1000000007
#define N 1000000

int visit[350][350];
int main() {

	ios::sync_with_stdio(0);
	cin.tie(0);

	int n, m, k;
	cin >> n >> m >> k;

	vector<vector<pair<int, int> > > v;
	vector<pair<int, int> > s;
	int c = k - 1;
	int d = 1;

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

		vector<pair<int, int> > x;
		if (d == 1) {
			for (int j = 1; j <= m; j++) {
				if (c) {
					x.push_back(mp(i, j));
					if (x.size() == 2) {
						v.push_back(x);
						x.clear();
						c--;
					}
				} else {
					s.push_back(mp(i, j));
				}
			}
			d = -1;
		} else if (d == -1) {
			for (int j = m; j >= 1; j--) {
				if (c) {
					x.push_back(mp(i, j));
					if (x.size() == 2) {
						v.push_back(x);
						x.clear();
						c--;
					}
				} else {
					s.push_back(mp(i, j));
				}
			}
			d = 1;
		}
	}

	for (int i = 0; i < v.size(); i++) {
		cout << v[i].size() << " ";
		for (int j = 0; j < v[i].size(); j++) {
			cout << v[i][j].first << " " << v[i][j].second << " ";
		}
		cout << endl;
	}

	cout << s.size() << " ";
	for (int i = 0; i < s.size(); i++) {
		cout << s[i].first << " " << s[i].second << " ";
	}
}


using namespace std;
#include<string.h>
#include <sstream>
typedef long long int ll;
typedef long double ld;
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <unordered_map>
#include <map>
//#define N 4
//const ll INF = 0x3f3f3f3f;
//const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
#include <queue>
#include <unordered_set>
#include <math.h>
#include <cstring>
#include <bitset>
#include <numeric>
#include <set>
#include <sstream>
#include <list>
#include <queue>
#define PI 3.14159265358979323846264338327950
#define mp make_pair
#define inf 1e9
#define M 1000000007
#define N 1000000

int visit[350][350];
int main() {

	ios::sync_with_stdio(0);
	cin.tie(0);

	int n, m, k;
	cin >> n >> m >> k;

	vector<pair<int, int> > v;
	vector<pair<int, int> > s;
	int c = k - 1;
	int d = 1;

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

		if (d == 1) {

			for (int j = 1; j <= m; j++) {
				if (c) {
					v.push_back(mp(i, j));
					c--;
				} else {
					s.push_back(mp(i, j));
				}
			}
			d = -1;
		} else if (d == -1) {

			for (int j = m; j >= 1; j--) {
				if (c) {
					v.push_back(mp(i, j));
					c--;
				} else {
					s.push_back(mp(i, j));
				}
			}
			d = 1;
		}
	}

	for (int i = 0; i < v.size(); i++) {
		cout << 1 << " ";
		cout << v[i].first << " " << v[i].second << endl;
	}

	cout << s.size() << " ";
	for (int i = 0; i < s.size(); i++) {
		cout << s[i].first << " " << s[i].second << " ";
	}
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, a, b) for(ll i=a;i<b;i++)
#define fi(i, a, b) for(ll i=b-1;i>=a;i--)
#define pb push_back
#define VI vector<int>
#define Vll vector<long long>

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,m,k;
    cin>>n>>m>>k;
    ll k1=k;
    ll t=n*m/k;
    ll t1=t;
    cout<<t1<<" ";
    f(i,1,n+1)
    {
        if(i%2==1)
        f(j,1,m+1)
        {
            if(!t1&&k==2) {cout<<"\n";t1=n*m-k1*t+t;cout<<t1<<" ";k--;}
            if(!t1&&k!=2) {cout<<"\n";t1=t;cout<<t1<<" ";k--;}
            if(t1){
            cout<<i<<" "<<j<<" ";t1--;}
        }

        if(i%2==0)
        fi(j,1,m+1)
        {
            if(!t1&&k==2) {cout<<"\n";t1=n*m-k1*t+t;cout<<t1<<" ";k--;}
            if(!t1&&k!=2) {cout<<"\n";t1=t;cout<<t1<<" ";k--;}
            if(t1){
            cout<<i<<" "<<j<<" ";t1--;}
        }
    }
}


/*
Mohit Dhattarwal
*/
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define foreach(it, v) for(auto it=(v).begin(); it != (v).end(); ++it)
#define gcd(a,b) __gcd(a,b)

#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define filewr() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<string,ll> psl;
typedef pair<ll,string> pls;

template<typename S, typename T>
ostream& operator<<(ostream& out,pair<S,T> const& p){out<<'('<<p.fi<<", "<<p.se<<')';return out;}

template<typename T>
ostream& operator<<(ostream& out,vector<T> const& v){
int l=v.size();for(int i=0;i<l-1;i++)out<<v[i]<<' ';if(l>0)out<<v[l-1];return out;}

template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}

template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}

const ld PI = 3.1415926535897932384626433832795;

typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> indexed_set;

void solve()
{
	ll n,m,k;
	cin>>n>>m>>k;
	ll a[m+1][n+1];
	set<pll> s;

	for(ll i =1; i<=n; i++)
	{
		for(ll j=1; j<=m; j++)
		{
			a[i][j] = 0;
			s.insert({i,j});
		}
	}

	ll count = 1;

	for(ll i=1; i<=n & count<k; i++)
	{
		for(ll j =1; j<=m; j++)
		{
			if(a[i][j]==0 && i!=m)
			{
				a[i][j] = count;
				a[i+1][j] = count;
				count++;
				s.erase({i,j});s.erase({i+1,j});
				cout<<2<<" "<<i<<" "<<j<<" "<<i+1<<" "<<j<<'\n';
				if(count==k)
				{
					break;
				}
			}
		}
	}

	if(count!=k)
	{
		for(ll i=1; i<=m; i++)
		{
			if(a[n][i]==0 && i!=m)
			{
				s.erase({n,i});s.erase({n,i+1});
				cout<<2<<" "<<n<<" "<<i<<" "<<n<<" "<<i+1<<'\n';
				a[n][i] = count;
				a[n][i+1] = count;
				count++;
				if(count==k)
				{
					break;
				}
			}
		}
	}
	cout<<s.size()<<" ";
	pll t = *s.begin();

	while(!s.empty())
	{
		cout<<t.fi<<" "<<t.se<<" ";
		a[t.fi][t.se] = count;
		s.erase(t);
		if(s.find({t.fi,t.se+1})!=s.end())
		{
			t = {t.fi,t.se+1};
		}
		else if(s.find({t.fi, t.se-1})!=s.end())
		{
			t = {t.fi, t.se-1};
		}
		else if(s.find({t.fi+1,t.se})!=s.end())
		{
			t = {t.fi+1, t.se};
		}

	}
	cout<<'\n';
}

int main(){
	fastio();
	ll t;
	t=1;
	while(t--)
	{
		solve();
	}
	return 0;
}


/*
Mohit Dhattarwal
*/
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define foreach(it, v) for(auto it=(v).begin(); it != (v).end(); ++it)
#define gcd(a,b) __gcd(a,b)

#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define filewr() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<string,ll> psl;
typedef pair<ll,string> pls;

template<typename S, typename T>
ostream& operator<<(ostream& out,pair<S,T> const& p){out<<'('<<p.fi<<", "<<p.se<<')';return out;}

template<typename T>
ostream& operator<<(ostream& out,vector<T> const& v){
int l=v.size();for(int i=0;i<l-1;i++)out<<v[i]<<' ';if(l>0)out<<v[l-1];return out;}

template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}

template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}

const ld PI = 3.1415926535897932384626433832795;

typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> indexed_set;

void solve()
{
	ll n,m,k;
	cin>>n>>m>>k;
	ll a[m+1][n+1];
	set<pll> s;

	for(ll i =1; i<=n; i++)
	{
		for(ll j=1; j<=m; j++)
		{
			a[i][j] = 0;
			s.insert({i,j});
		}
	}

	ll count = 1;

	for(ll i=1; i<=n & count<k; i++)
	{
		for(ll j =1; j<=m; j++)
		{
			if(a[i][j]==0 && i!=m)
			{
				a[i][j] = count;
				a[i+1][j] = count;
				count++;
				s.erase({i,j});s.erase({i+1,j});
				cout<<2<<" "<<i<<" "<<j<<" "<<i+1<<" "<<j<<'\n';
				if(count==k)
				{
					break;
				}
			}
		}
	}

	if(count!=k)
	{
		for(ll i=1; i<=m; i++)
		{
			if(a[n][i]==0 && i!=m)
			{
				s.erase({n,i});s.erase({n,i+1});
				cout<<2<<" "<<n<<" "<<i<<" "<<n<<" "<<i+1<<'\n';
				a[n][i] = count;
				a[n][i+1] = count;
				count++;
				if(count==k)
				{
					break;
				}
			}
		}
	}
	cout<<s.size()<<" ";
	pll t = *s.begin();
	ll num = s.size();
	while(num>1)
	{
		cout<<t.fi<<" "<<t.se<<" ";
		a[t.fi][t.se] = count;
		s.erase(t);
		if(s.find({t.fi,t.se+1})!=s.end())
		{
			t = {t.fi,t.se+1};
		}
		else if(s.find({t.fi, t.se-1})!=s.end())
		{
			t = {t.fi, t.se-1};
		}
		else if(s.find({t.fi+1,t.se})!=s.end())
		{
			t = {t.fi+1, t.se};
		}
		num--;

	}
	cout<<'\n';
}

int main(){
	fastio();
	ll t;
	t=1;
	while(t--)
	{
		solve();
	}
	return 0;
}


/*
Mohit Dhattarwal
*/
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define foreach(it, v) for(auto it=(v).begin(); it != (v).end(); ++it)
#define gcd(a,b) __gcd(a,b)

#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define filewr() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<string,ll> psl;
typedef pair<ll,string> pls;

template<typename S, typename T>
ostream& operator<<(ostream& out,pair<S,T> const& p){out<<'('<<p.fi<<", "<<p.se<<')';return out;}

template<typename T>
ostream& operator<<(ostream& out,vector<T> const& v){
int l=v.size();for(int i=0;i<l-1;i++)out<<v[i]<<' ';if(l>0)out<<v[l-1];return out;}

template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}

template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}

const ld PI = 3.1415926535897932384626433832795;

typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> indexed_set;

void solve()
{
	ll n,m,k;
	cin>>n>>m>>k;
	ll a[m+1][n+1];
	set<pll> s;

	for(ll i =1; i<=n; i++)
	{
		for(ll j=1; j<=m; j++)
		{
			a[i][j] = 0;
			s.insert({i,j});
		}
	}

	ll count = 1;

	for(ll i=1; i<=n & count<k; i++)
	{
		for(ll j =1; j<=m; j++)
		{
			if(a[i][j]==0 && i!=m)
			{
				a[i][j] = count;
				a[i+1][j] = count;
				count++;
				s.erase({i,j});s.erase({i+1,j});
				cout<<2<<" "<<i<<" "<<j<<" "<<i+1<<" "<<j<<'\n';
				if(count==k)
				{
					break;
				}
			}
		}
	}

	if(count!=k)
	{
		for(ll i=1; i<=m; i++)
		{
			if(a[n][i]==0 && i!=m)
			{
				s.erase({n,i});s.erase({n,i+1});
				cout<<2<<" "<<n<<" "<<i<<" "<<n<<" "<<i+1<<'\n';
				a[n][i] = count;
				a[n][i+1] = count;
				count++;
				if(count==k)
				{
					break;
				}
			}
		}
	}
	cout<<s.size()<<" ";
	pll t = *s.begin();

	while(!s.empty())
	{
		cout<<t.fi<<" "<<t.se<<" ";
		a[t.fi][t.se] = count;
		s.erase(t);
		if(s.find({t.fi,t.se+1})!=s.end())
		{
			t = {t.fi,t.se+1};
		}
		else if(s.find({t.fi, t.se-1})!=s.end())
		{
			t = {t.fi, t.se-1};
		}
		else if(s.find({t.fi+1,t.se})!=s.end())
		{
			t = {t.fi+1, t.se};
		}
		else
		{
			break;
		}

	}
	cout<<'\n';
}

int main(){
	fastio();
	ll t;
	t=1;
	while(t--)
	{
		solve();
	}
	return 0;
}


/*
Mohit Dhattarwal
*/
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define foreach(it, v) for(auto it=(v).begin(); it != (v).end(); ++it)
#define gcd(a,b) __gcd(a,b)

#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define filewr() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<string,ll> psl;
typedef pair<ll,string> pls;

template<typename S, typename T>
ostream& operator<<(ostream& out,pair<S,T> const& p){out<<'('<<p.fi<<", "<<p.se<<')';return out;}

template<typename T>
ostream& operator<<(ostream& out,vector<T> const& v){
int l=v.size();for(int i=0;i<l-1;i++)out<<v[i]<<' ';if(l>0)out<<v[l-1];return out;}

template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}

template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}

const ld PI = 3.1415926535897932384626433832795;

typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> indexed_set;

void solve()
{
	ll n,m,k;
	cin>>n>>m>>k;
	ll a[m+1][n+1];
	set<pll> s;

	for(ll i =1; i<=n; i++)
	{
		for(ll j=1; j<=m; j++)
		{
			a[i][j] = 0;
			s.insert({i,j});
		}
	}

	ll count = 1;

	for(ll i=1; i<=n & count<k; i++)
	{
		for(ll j =1; j<=m; j++)
		{
			if(a[i][j]==0 && i!=m)
			{
				a[i][j] = count;
				a[i+1][j] = count;
				count++;
				s.erase({i,j});s.erase({i+1,j});
				cout<<2<<" "<<i<<" "<<j<<" "<<i+1<<" "<<j<<'\n';
				if(count==k)
				{
					break;
				}
			}
		}
	}

	if(count!=k)
	{
		for(ll i=1; i<=m; i++)
		{
			if(a[n][i]==0 && i!=m)
			{
				s.erase({n,i});s.erase({n,i+1});
				cout<<2<<" "<<n<<" "<<i<<" "<<n<<" "<<i+1<<'\n';
				a[n][i] = count;
				a[n][i+1] = count;
				count++;
				if(count==k)
				{
					break;
				}
			}
		}
	}
	cout<<s.size();
	pll t = *s.begin();
	ll num = s.size();
	while(!s.empty())
	{
		if(s.find(t)!=s.end())
		{
			cout<<" "<<t.fi<<" "<<t.se;
			a[t.fi][t.se] = count;
			s.erase(t);
			if(s.find({t.fi,t.se+1})!=s.end())
			{
				t = {t.fi,t.se+1};
			}
			else if(s.find({t.fi, t.se-1})!=s.end())
			{
				t = {t.fi, t.se-1};
			}
			else if(s.find({t.fi+1,t.se})!=s.end())
			{
				t = {t.fi+1, t.se};
			}
		}
		else
		{
			break;
		}

	}
	cout<<'\n';
}

int main(){
	fastio();
	ll t;
	t=1;
	while(t--)
	{
		solve();
	}
	return 0;
}


/*
Mohit Dhattarwal
*/
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define foreach(it, v) for(auto it=(v).begin(); it != (v).end(); ++it)
#define gcd(a,b) __gcd(a,b)

#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define filewr() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<string,ll> psl;
typedef pair<ll,string> pls;

template<typename S, typename T>
ostream& operator<<(ostream& out,pair<S,T> const& p){out<<'('<<p.fi<<", "<<p.se<<')';return out;}

template<typename T>
ostream& operator<<(ostream& out,vector<T> const& v){
int l=v.size();for(int i=0;i<l-1;i++)out<<v[i]<<' ';if(l>0)out<<v[l-1];return out;}

template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}

template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}

const ld PI = 3.1415926535897932384626433832795;

typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> indexed_set;

void solve()
{
	ll n,m,k;
	cin>>n>>m>>k;
	ll num = (n*m)/k;
	ll count = (n*m)%k;

	set<pll> s;

	for(ll i =1; i<=n; i++)
	{
		for(ll j=1; j<=m; j++)
		{
			s.insert({i,j});
		}
	}
	//tr(num,count);
	pll t = *s.begin();

	for(ll i =0; i<k; i++)
	{
		if(count>0)
		{
			cout<<num+1<<" ";
			for(ll i =0; i<num+1; i++)
			{

				cout<<t.fi<<" "<<t.se<<" ";
				s.erase(t);
				if(s.find({t.fi,t.se+1})!=s.end())
				{
					t = {t.fi,t.se+1};
				}
				else if(s.find({t.fi,t.se-1})!=s.end())
				{
					t = {t.fi,t.se-1};
				}
				else if(s.find({t.fi+1,t.se})!=s.end())
				{
					t = {t.fi+1,t.se};
				}
			}
			cout<<'\n';
			count--;
		}
		else
		{
			cout<<num<<" ";
			for(ll i =0; i<num; i++)
			{
				//tr(1);

				cout<<t.fi<<" "<<t.se<<" ";
				s.erase(t);
				if(s.find({t.fi,t.se+1})!=s.end())
				{
					t = {t.fi,t.se+1};
				}
				else if(s.find({t.fi,t.se-1})!=s.end())
				{
					t = {t.fi,t.se-1};
				}
				else if(s.find({t.fi+1,t.se})!=s.end())
				{
					t = {t.fi+1,t.se};
				}
			}
			cout<<'\n';
		}
	}

}

int main(){
	fastio();
	ll t;
	t=1;
	while(t--)
	{
		solve();
	}
	return 0;
}


/*
Mohit Dhattarwal
*/
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define foreach(it, v) for(auto it=(v).begin(); it != (v).end(); ++it)
#define gcd(a,b) __gcd(a,b)

#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define filewr() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<string,ll> psl;
typedef pair<ll,string> pls;

template<typename S, typename T>
ostream& operator<<(ostream& out,pair<S,T> const& p){out<<'('<<p.fi<<", "<<p.se<<')';return out;}

template<typename T>
ostream& operator<<(ostream& out,vector<T> const& v){
int l=v.size();for(int i=0;i<l-1;i++)out<<v[i]<<' ';if(l>0)out<<v[l-1];return out;}

template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}

template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}

const ld PI = 3.1415926535897932384626433832795;

typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> indexed_set;

void solve()
{
	int n,m,k;
	cin>>n>>m>>k;
	int a[m+1][n+1];
	set<pii> s;

	for(int i =1; i<=n; i++)
	{
		for(int j=1; j<=m; j++)
		{
			a[i][j] = 0;
			s.insert({i,j});
		}
	}

	int count = 1;

	for(int i=1; i<=n & count<k; i++)
	{
		for(int j =1; j<=m; j++)
		{
			if(a[i][j]==0 && i!=m)
			{
				a[i][j] = count;
				a[i+1][j] = count;
				count++;
				s.erase({i,j});s.erase({i+1,j});
				cout<<2<<" "<<i<<" "<<j<<" "<<i+1<<" "<<j<<'\n';
				if(count==k)
				{
					break;
				}
			}
		}
	}

	if(count!=k)
	{
		for(int i=1; i<=m; i++)
		{
			if(a[n][i]==0 && i!=m)
			{
				s.erase({n,i});s.erase({n,i+1});
				cout<<2<<" "<<n<<" "<<i<<" "<<n<<" "<<i+1<<'\n';
				a[n][i] = count;
				a[n][i+1] = count;
				count++;
				if(count==k)
				{
					break;
				}
			}
		}
	}
	cout<<s.size();
	pii t = *s.begin();
	int num = s.size();
	while(!s.empty())
	{
		if(s.find(t)!=s.end())
		{
			cout<<" "<<t.fi<<" "<<t.se;
			a[t.fi][t.se] = count;
			s.erase(t);
			if(s.find({t.fi,t.se+1})!=s.end())
			{
				t = {t.fi,t.se+1};
			}
			else if(s.find({t.fi, t.se-1})!=s.end())
			{
				t = {t.fi, t.se-1};
			}
			else if(s.find({t.fi+1,t.se})!=s.end())
			{
				t = {t.fi+1, t.se};
			}
		}
		else
		{
			break;
		}

	}
	cout<<'\n';
}

int main(){
	fastio();
	ll t;
	t=1;
	while(t--)
	{
		solve();
	}
	return 0;
}