#include <iostream>
using namespace std;
#include <string>
#include <algorithm>
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n,m;
cin>>n>>m;
cin.ignore();
string s,t;
while (getline(cin,t)&&!t.empty()){
s+=t+"\n";
}
s.pop_back();
reverse(s.begin(),s.end());
cout<<s;
return 0;
}
// 64 位输出请用 printf("%lld")

京公网安备 11010502036488号