#include <bits/stdc++.h>   using namespace std;   int res[111];   int a[111][111];   bool used[111];   ;   bool used_j[111];   int v[111];   int main() {     int n, m, k;     cin >> n >> m >> k;     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         cin >> a[i][j];       }     }     for (int i = 0; i < m; i++) {       for (int w = 0; w < 111; w++) {         v[w] = 0;       }       for (int j = 0; j < n; j++) {         if (!used[a[j][i]] && !used_j[j])           v[a[j][i]]++;         else if (!used_j[j] && used[a[j][i]]) {           if (res[j] == 0) res[j] = i + 1;           used_j[j] = 1;         }       }       for (int j = 0; j < n; j++) {         if (v[a[j][i]] > 1 && a[j][i] != 0) {           if (res[j] == 0) res[j] = i + 1;           used[a[j][i]] = 1;           used_j[j] = 1;         }       }     }     for (int i = 0; i < n; i++) {       cout << res[i] << endl;     }     return 0;   }   