#include <bits/stdc++.h>
#define int long long
using namespace std;
int a[1005][1005];
signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, m, k;
	cin >> n >> m >> k;
	int j = k % m;
	if (!j) j = m;
	int i = (k - j) / m + 1;
	//cout << i << " " << j << endl;
	int xi = i, xj = j, x;
	for (; xi > 1 && xj > 1; xi--, xj--) {}
	//cout << xi << " " << xj << endl;
	if (xj == 1) x = n + 1 - xi;
	else x = xj + n - 1;
	int yi = i, yj = j, y;
	for (; yi > 1 && yj < m; yi--, yj++) {}
	//cout << yi << " " << yj << endl;
	if (yi == 1) y = yj;
	else y = yi + m - 1;
	cout << y << " " << x;
	return 0;
}