#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n,m,k;
cin>>n>>m>>k;
int q[n][m];
int a[k][n];
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cin>>q[i][j];
}
}
for(int i=0;i<k;i++){
for(int j=0;j<n;j++){
cin>>a[i][j]
}
}
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IG1haW4oKXsKCWlvczo6c3luY193aXRoX3N0ZGlvKDApOwoJY2luLnRpZSgwKTsgY291dC50aWUoMCk7CglpbnQgbixtLGs7CgljaW4+Pm4+Pm0+Pms7CglpbnQgcVtuXVttXTsKCWludCBhW2tdW25dOwoJZm9yKGludCBpPTA7aTxuO2krKyl7CgkJZm9yKGludCBqPTA7ajxuO2orKyl7CgkJCWNpbj4+cVtpXVtqXTsKCQl9Cgl9Cglmb3IoaW50IGk9MDtpPGs7aSsrKXsKCQlmb3IoaW50IGo9MDtqPG47aisrKXsKCQkJY2luPj5hW2ldW2pdCgkJfQoJfQp9