#include<bits/stdc++.h> using namespace std; int main(){ int n, m, x, r, c; cin >> n >> m >> x; r = (x - 1) / m + 1; c = x % m; if(c == 0){ c = 3; } cout << r + c - 1 << " " << n + c - r; return 0; }