#include using namespace std; typedef long long ll; int main(void) { int R,K,H,W; char tmp; cin >> R >> K >> H >> W; bool c[H][W]; for (int i=0; i> tmp; if (tmp == '#') c[i][j] = true; else c[i][j] = false; } switch(R/90) { case 0: for (int i=0; i=0; i--) { for (int j=W*K-1; j>=0; j--) { if (c[i/K][j/K]) cout << '#'; else cout << '.'; } cout << endl; } break; case 3: for (int j=W*K-1; j>=0; j--) { for (int i=H*K-1; i>=0; i--) { if (c[i/K][j/K]) cout << '#'; else cout << '.'; } cout << endl; } break; } return 0; }