#include using namespace std; using ll = long long; constexpr ll mod = 998244353; template struct Mint { using M=Mint; ll v; M& put(ll x) { v=(x>=1; } return res; } M inv() { return pow(mod-2); } }; int main(){ int n, k; cin >> n >> k; vector v(n); for(int i = 0; i < n; ++i){ cin >> v[i]; } for(int i = 0; i < n * k; ++i){ for(int j = 0; j < n * k; ++j){ char c = v[i / k][j / k]; cout << c; } cout << endl; } }