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