#include#includeusing namespace std;int main(){int k,q,r;cin>>k>>q>>r;string s[k],S[k],A[k][q];cin>>s[k];for(int i=0;iS[i]=s[i];//S為新,s為舊}int p[q][k];//q為橫for(int i=0;ifor(int j=0;jcin>>p[i][j];S[p[i][j]-1]=s[j];}for(int a=0;aA[a][i]=S[a];}for(int b=0;bs[b]=S[b];}}for(int i=0;ifor(int j=0;jcout<}cout<<"\n";}return 0;}