#include using namespace std; #define rep(i, a, b) for (ll i = a; i < b; i++) using ll = long long; int main(){ int h, w; cin >> h >> w; vector s(h); rep(i, 0, h) cin >> s[i]; rep(j, 0, w) { rep(i, 0, h) { char c = s[h - 1 - i][j]; cout << c; } cout << endl; } }