//#pragma comment(linker, "/STACK:16777216")
#include<iostream>
#include<cstdio>
//#include<cmath>
#include<algorithm>
#include<vector> 
#include<cstring>
#include<string>
//#include<queue>
#define mp make_pair
#define scn second
#define frs first
#define pb push_back
#define NAME "ragnarok"
#define fop freopen(NAME ".in", "r", stdin); freopen(NAME ".out", "w", stdout); 
using namespace std;
const unsigned long long P=239017, MaxN=2100000, INF=100000000;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pi;


char s[300100];
ll hs[300100], hs_r[300100], p[310100];
ll get(int l, int r) {
	return hs[r + 1] - hs[l] * p[r - l + 1];
}
int len;
ll get_r(int l, int r) {
	return hs_r[l] - hs_r[r + 1] * p[r - l + 1];
}

int main(){
	fop;
	scanf("%s", s);
	len = strlen(s);
	p[0] = 1;
	for (int i = 1; i <= len + 1000; ++i)
		p[i] = p[i - 1] * P;
	for (int i = 0; i < len; ++i)
		hs[i + 1] = hs[i] * P + s[i];	
	for (int i = len - 1; i >= 0; --i)
		hs_r[i] = hs_r[i + 1] * P + s[i];	
	

	int mn = len;
	for (int add = 0; add < len; ++add) {
		if (get(add, len - 1) == get_r(add, len - 1)) {
			mn = min(add, mn);
		}
	}
	reverse(s, s + len);
	for (int i = len - 1; i >= 0; --i)
		hs_r[i] = hs_r[i + 1] * P + s[i];	
	for (int i = 0; i < len; ++i)
		hs[i + 1] = hs[i] * P + s[i];		
	for (int add = 0; add < len; ++add) {
		if (get(add, len - 1) == get_r(add, len - 1)) {
		    if (add < mn) {
		    	for (int i = 0; i < len; ++i)
					printf("%c", s[i]);
				for (int i = add - 1; i >= 0; --i)
					printf("%c", s[i]);				
		    	return 0;		
			}
		}
	}
	reverse(s, s + len);
	
	for (int i = 0; i < len; ++i)
		printf("%c", s[i]);
	for (int i = mn - 1; i >= 0; --i)
		printf("%c", s[i]);

	return 0;
}