#include using namespace std; using ll = long long; using vi = vector; using vs = vector; using vvi = vector; using vll = vector; using vvll = vector; using pii = pair; using pll = pair; #define rep(i,j,n) for(ll i=j;i> s; rp(i, s.size()) { string k; // cout << s.substr(s.size() - 1 - i); if(kaibun(s.substr(s.size()-1-i))) k=s.substr(0,s.size()-i-1); // cout << k << endl; reverse(all(k)); if(kaibun(s) || k!="")ans = s + k; } cout << ans << endl; }