#include<iostream>
using namespace std;
int main(){int N,M,K,a[10][10],i,j;cout<<"N=";cin>>N;cout<<"M=";cin>>M;cout<<"K=";cin>>K;for(i=0;i<N;i++)for(j=0;j<M;j++)cin>>a[i][j];for(i=K-1;i<N-1;i++)for(j=0;j<M;j++)a[i][j]=a[i+1][j];N--;for(i=0;i<N;i++){for(j=0;j<M;j++)cout<<a[i][j]<<" ";cout<<endl;}return 0;}