# include <bits/stdc++.h>
using namespace std;
const int MAX = 32768 * 2 + 100;
long long n, m, k, cnt = 1;
long long sxjudge(){
	int sx = 0, stime = 0, scnt = 1; // x = scnt
	for (int i = 1; i < m; i++){
		for (int j = 1; j < m; j++){
			sx = sx + i;
			if (k == sx){
				return scnt;
			}
			stime++;
			if (stime == scnt){
				stime = 0;
				scnt++;
			}
		}
	}
	return -1;
}
long long syjudge(){
	for (int i = 2; i <= m; i++){
		int sy = i;
		if (k == sy){
			return i - 1 + n;
		}
		for (int j = 1; j <= m - i; j++){
			sy = sy + m + 1;
			if (k == sy){
				return i - 1 + n;
			}
		}
	}
	return -1;
}
int main(){
	cin >> n >> m >> k;
	int temp = k;
	// x
	int x = 0, xtime = 1;
	if (sxjudge() != -1){
		cout << sxjudge() << " ";
	}
	else{
		while (temp % m != 0 && xtime <= n){
			xtime++;
			temp -= (m - 1);
		}
		x = temp / m;
		x = x + m - 1;
		cout << x << " ";
	}
	// y
	temp = k;
	int y = 0, ytime = 1;
	if (syjudge() != -1){
		cout << syjudge();
	}
	else{
		while (temp % m != 1 && ytime <= n){
			ytime++;
			temp -= (m + 1);
		}
		y = (temp - 1) / m + 1;
		y = n + 1 - y;
		cout << y;
	}
	return 0;
}