#include <bits/stdc++.h> using namespace std; int n, m, s; int walk[4][2] = {0, -1, -1, 0, 0, 1, 1, 0}; bool vis[105][105]; void dfs (int i, int j, int shu){ if (shu == s){ printf("%d %d", i, n - j); exit(0); } for (int f = 0; f < 4; f++){ int ti = i + walk[f][0], tj = j + walk[f][1]; if (ti < 1 || tj < 1 || ti > n || tj > m || vis[ti][tj] == 1) continue; vis[ti][tj] = 1; if (ti == i && tj == j - 1) dfs(ti, tj, shu - 1); else if (ti == i && tj == j + 1) dfs(ti, tj, shu + 1); else if (tj == j && ti == i - 1) dfs(ti, tj, shu - m); else if (tj == j && ti == i + 1) dfs(ti, tj, shu + m); } } int main (){ scanf ("%d%d%d", &n, &m, &s); if (n == 1 && m == 1) { cout << "1 1"; } else dfs (n, m, n * m); return 0; }