#include using namespace std; const int INF = 1<<30; const int MOD = 998244353; //const long long INF = 1LL<<60; using graph = vector>; using ll = long long; int main(){ int n, k; cin >> n >> k; vector a(n); for (int i=0; i < n; i++) cin >> a[i]; for (int i=0; i < n*k; i++){ for (int j=0; j < n*k; j++){ cout << a[i / k][j / k]; } cout << endl; } }