/* -*- coding: utf-8 -*- * * 2234.cc: No.2234 palindromer - yukicoder */ #include #include #include using namespace std; /* constant */ const int MAX_N = 100; /* typedef */ /* global variables */ char s[MAX_N + 4]; /* subroutines */ inline bool palindrome(int n, char t[]) { for (int i = 0, j = n - 1; i < j; i++, j--) if (t[i] != t[j]) return false; return true; } /* main */ int main() { scanf("%s", s); int n = strlen(s); int k = 0; for (; k < n; k++) if (palindrome(n - k, s + k)) break; for (int i = 0; i < n; i++) putchar(s[i]); for (int i = k - 1; i >= 0; i--) putchar(s[i]); putchar('\n'); return 0; }