#include <stdio.h>
#include <stdlib.h>
void main()
{
char c;
int left=0,right=0;
while ( (c=getchar()) != EOF )
{
if ( c == '{')
left++;
else if ( c == '}')
{
if ( left <= right)
printf("extor/n");
else
right++;
}
}
if ( left == right )
printf("OK/n");
else
printf("NO/n");
return EXIT_SUCCESS;
}