#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <numeric>
#include <map>
#include <vector>
#include <string>
#include <vector>
#include <cassert>
#include <cmath>
#include <stack>
#include <cctype>
#include <queue>
#include <algorithm>
#include <memory>
#include <memory.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> PP;
const int INF = 1 << 30;
const double EPS = 1e-10;
const double PI = 3.14159;

int route[1001][1001];
int dp[1001][1001];

int main(){
	int h, w, n;
	while(cin >> h >> w >> n && (h || w || n)){
		for(int i = 0; i < h; i++){
			for(int j = 0; j < w; j++){
				cin >> route[i][j];
			}
		}
		memset(dp, 0, sizeof(dp));
		dp[0][0] = n-1;
		for(int i = 0; i < h; i++){
			for(int j = 0; j < w; j++){
				if(dp[i][j] % 2 == 0){
					dp[i+1][j] += dp[i][j] / 2;
					dp[i][j+1] += dp[i][j] / 2;
				}else{
					if(route[i][j] == 1){
						dp[i][j+1] += dp[i][j] / 2 + 1;
						dp[i+1][j] += dp[i][j] / 2;
					}else{
						dp[i][j+1] += dp[i][j] / 2;
						dp[i+1][j] += dp[i][j] / 2 + 1;
					}
				}
			}
		}
		for(int i = 0; i < h; i++){
			for(int j = 0; j < w; j++){
				route[i][j] = (route[i][j] + dp[i][j]) % 2;
			}
		}
		int y = 0, x = 0;
		while(y < h && x < w){
			if(route[y][x] == 1) x++;
			else y++;
		}
		cout << y + 1 << " " << x + 1 << endl;
	}
	return 0;
}