#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
int main(){
int n,m,targe;
cin >> n >> m >> targe;
int a[n][m];
for(int i = 0; i < n; i ++){
for(int j = 0; j < m; j ++){
cin >> a[i][j];
}
}
int l = 0,r = n * m - 1; // 转化成为一维数组进行二分
while(l < r){
int mid = (l + r) / 2;
if(a[mid / m][mid % m] >= targe) r = mid; // 下标规律
else l = mid + 1;
}
if(a[l / m][l % m] == targe){
cout << "true" << endl;
}else{
cout << "false" << endl;
}
return 0;
}