#include #include #include #include #include #include using namespace std; #define N 100 const int inf=100000000; int main() { int i,n; char s[N]; while(~scanf("%s",s)) { n=strlen(s); if(n%3||s[0]==s[n/3]||s[0]==s[n-1]||s[n/3]==s[n-1]) { printf("NO\n"); continue; } int flag=1; for(i=1;i