#include <iostream>

using namespace std;

int st[105];

int main() {
	int N, x;
	cin >> N;
	for (int n = 0; n < N; n++) {
		cin >> x;
		st[n] = 0;
		while (x > 0) {
			st[n] = 10 * st[n] + x % 10;
			x /= 10;
		}
	}
	for (int n = N - 1; n >= 0; n--)
		cout << st[n] << '\n';

	return 0;
}