#include<bits/stdc++.h> using namespace std; int main() { int n,m; cin >> n >> m; int a[n + 1][m+10]; int sum = 0; for(int i = 1; i <= n; i++) { for(int j = 1; j <= m; j++) { sum ++; a[i][j] = sum; } } int k; cin >> k; int y = 1,x = n; int yy = 1,xx = n; int h=1; for(int i = 1; i <= n; i++) { for(int j = 1; j <= m; j ++) { // cout << y << " " << x << endl; if(a[i][j] == k) { cout << y << " " << x; return 0; } if(h < m) { h++; y++; x++; } else { y = yy + 1; yy ++; x = xx - 1; xx --; h = 1; } } } return 0; }