#include <bits/stdc++.h>
using namespace std;
string f(string s,int cnt, int i, int j, int n){
if(i>=j){
if(cnt==n/2)
return "true";
else
return "false";
}
if(s[i]==s[j]){
cnt++;
return f(s,cnt, i+1,j-1,n);
}
else
return "false";
}
int main() {
string s="abba";int cnt=0;
int i=0; int j=3; int n=4;
cout<<f(s,cnt,i,j,n);
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgpzdHJpbmcgZihzdHJpbmcgcyxpbnQgY250LCBpbnQgaSwgaW50IGosIGludCBuKXsKCWlmKGk+PWopewoJCWlmKGNudD09bi8yKQoJCSByZXR1cm4gInRydWUiOwoJCSBlbHNlCgkJIHJldHVybiAiZmFsc2UiOwoJfQoJaWYoc1tpXT09c1tqXSl7CgkJY250Kys7CgkJcmV0dXJuIGYocyxjbnQsIGkrMSxqLTEsbik7Cgl9CgllbHNlCglyZXR1cm4gImZhbHNlIjsKfQoKaW50IG1haW4oKSB7CglzdHJpbmcgcz0iYWJiYSI7aW50IGNudD0wOwoJaW50IGk9MDsgaW50IGo9MzsgaW50IG49NDsKCWNvdXQ8PGYocyxjbnQsaSxqLG4pOwoJcmV0dXJuIDA7Cn0=