#include <bits/stdc++.h> using namespace std; int main() { int n, m, k; cin >> n >> m >> k; int t1 = k % m, x = (k - t1) / m + 1; if(k % m == 0) x--; if(t1 == 0) t1 = m; int y = t1; //cout << x << ' ' << y << endl; int ny = abs(n - x) + abs(1 - y) + 1; int nx = abs(1 - x) + abs(1 - y) + 1; cout << nx << ' ' << ny << endl; return 0; }