#include using namespace std; using ll = long long; using ull = unsigned long long; using Matrix = vector>; const int inf = 1000000000; const ll INF = 1000000000000000000; const ll mod = 998244353; const ull mod_hash = (1UL << 61) - 1; const vector dx = {0, 1, 0, -1, 1, 1, -1, -1}; const vector dy = {1, 0, -1, 0, 1, -1, 1, -1}; int main(){ int N, K;cin>>N>>K; vector> G(N, vector(N)); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { cin>>G[i][j]; } } vector> A(N*K, vector(N*K)); for (int i = 0; i < N*K; i++) { for (int j = 0; j < N*K; j++) { A[i][j] = G[i/K][j/K]; } } for (int i = 0; i < N*K; i++) { for (int j = 0; j < N*K; j++) { cout<