#include using namespace std; #define pb push_back using ll = long long; using vi = vector ; const ll mod = 1e9 + 7; int main() { ios::sync_with_stdio(0); string s; cin >> s; int n = s.size(); for(int i = 0; i < n; i ++) { string t = s.substr(0, i); reverse(t.begin(), t.end()); t = s + t; string r = t; reverse(r.begin(), r.end()); if(r == t) { cout << t << '\n'; break; } } }