#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt" > "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\b.answer"
int main() {
	while (1) {
		int H, W, N; cin >> H >> W >> N;
		if (!H)break;
		vector<vector<int>>easts(H, vector<int>(W));
		for (int i = 0; i < H; ++i) {
			for (int j = 0; j < W; ++j) {
				cin >> easts[i][j];
			}
		}
		vector<vector<int>>nums(H+1, vector<int>(W+1));
		nums[0][0] = N - 1;
		for (int i = 0; i < H; ++i) {
			for (int j = 0; j < W; ++j) {
				const int total = nums[i][j];
				int a = (total + 1) / 2;
				int b = total / 2;
				if (!easts[i][j]) {
					nums[i][j + 1] += b;
					nums[i + 1][j] += a;
				}
				else {
					nums[i][j + 1] += a;
					nums[i + 1][j] += b;
				}
			}
		}
		int nx = 0, ny = 0;
		while (nx != W&&ny != H) {
			if ((easts[ny][nx] + nums[ny][nx]) % 2) {
				nx++;
			}
			else {
				ny++;
			}
		}
		cout << ny+1 << " " << nx+1 << endl;
	}
	return 0;
}