#include <iostream>
#include <cstring>
using namespace std;
int main (){
  string s;
  cin >> s;
  char c = s.front();
  s.erase(0,1);
  s.insert(s.end(), c);
  cout << s;
  return 0;
}
#include<bits/stdc++.h>

#define fox(i,a,b) for(int i=a;i<=b;++i)
#define ll long long

using namespace std;

int _x, _f; char _c;
inline int rd() {
	_x = 0, _f = 1, _c = getchar();
	for (; !isdigit(_c); _c = getchar()) if (_c == '-') _f = 0;
	for (; isdigit(_c); _c = getchar()) _x = _x * 10 + _c - '0';
	return _f ? _x : -_x;
}

char s[10]; 

signed main() {
	scanf("%s", s + 1);
	cout << s[2] << s[3] << s[1] << endl;
	return 0;
}
