#include<iostream>
using namespace std;
int main()
{
	long n,m,k;
	start:cin >> n >> m >> k;
	int x = (k-1)%m,y = (k-1)/m;
	cout << x << ' ' << y << endl;
	cout << x+y+1 << ' ' << n-y+x << endl;
	goto start;
}