#include <iostream>
#include <vector>
#define SIZE 3
using namespace std;
int main() {
vector<string> temp = {"123", "8 4", "765"};
vector<string> res(SIZE, " ");
// 시계
for (int i = 0; i < SIZE; i++) {
for (int j = 0; j < SIZE; j++) {
res[j][SIZE-i-1] = temp[i][j];
}
}
for (auto c : res) {
cout << c << "\n";
}
cout << "=====\n";
// 반시계
for (int i = 0; i < SIZE; i++) {
for (int j = 0; j < SIZE; j++) {
res[SIZE-j-1][i] = temp[i][j];
}
}
for (auto c : res) {
cout << c << "\n";
}
}