#include <iostream>
#include <string>
using namespace std;
void outputLine(string str){
int j;
for (j = 0; j < str.length(); j++){
cout << str.substr(str.length() - j - 1, 1);
}
cout << endl;
}
int main()
{
int i, countStr = 0;
string *str;
cout << "Enter the numbers of rows: ";
cin >> countStr;
str = new string[countStr];
for (i = 0; i < countStr; i++){
cin.ignore();
getline(cin,str[i]);
if (str[i].length() > 10){
cout << "String more than 80 characters!" << endl;
return 0;
}
}
for (i = 0; i < countStr; i++){
outputLine(str[i]);
}
delete[] str;
return 0;
}