#include #if __has_include () #include using namespace atcoder; #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; bool isPalindrome(string s) { return equal(s.begin(), s.end(), s.rbegin()); } int main() { string a; cin >> a; int n = a.size(); for (int i = n; i <= n*2; ++i) { string s{a}; for (int j = i-n-1; j >= 0; --j) s += a[j]; if (isPalindrome(s)) { cout << s << '\n'; return 0; } } return 0; }