#include using namespace std; int main() { int N, K; cin >> N >> K; vector S(N); for (int i = 0; i < N; i++) { cin >> S[i]; } vector> A(N * K, vector(N * K)); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { for (int k = 0; k < K; k++) { for (int l = 0; l < K; l++) { A[i * K + k][j * K + l] = S[i][j]; } } } } for (int i = 0; i < N * K; i++) { for (int j = 0; j < N * K; j++) { cout << A[i][j]; } cout << endl; } }