# include <stdio.h>
# include <string.h>
# include <stdlib.h>
char stack[ 50 ] ;
int top=- 1 ;
int push( char elem)
{
if ( top< 50 )
{
top++;
stack[ top] = elem;
return ( 1 ) ; }
else { return 0 ; }
}
char pop( )
{
if ( top==- 1 )
{
return ( 0 ) ; }
else {
return ( stack[ top-- ] ) ;
}
}
int main( )
{ int N; char arr[ 50 ] ;
int count= 0 ;
int n;
int k;
for ( k= 0 ; k< N; k++ )
{
int i;
for ( i= 0 ; i< length; i++ )
{
char x= arr[ i] ;
push( x) ;
}
int j;
char y[ 50 ] ;
for ( j= 0 ; j< length; j++ )
{
y[ j] = pop( ) ; }
for ( n= 0 ; n< length; n++ )
{ if ( arr[ n] == y[ n] ) {
count++; } }
if ( count== length)
}
}
return ( 0 ) ;
}
IyBpbmNsdWRlIDxzdGRpby5oPgojIGluY2x1ZGUgPHN0cmluZy5oPgojIGluY2x1ZGUgPHN0ZGxpYi5oPgpjaGFyIHN0YWNrWzUwXTsKaW50IHRvcD0tMTsKaW50IHB1c2goY2hhciBlbGVtKQp7CmlmKHRvcDw1MCkKewp0b3ArKzsKc3RhY2tbdG9wXT1lbGVtOwpyZXR1cm4oMSk7fQplbHNlIHtyZXR1cm4gMDt9Cn0KY2hhciBwb3AoKQp7CmlmKHRvcD09LTEpCnsKcmV0dXJuKDApO30KZWxzZXsKcmV0dXJuKHN0YWNrW3RvcC0tXSk7Cn0KfQppbnQgbWFpbigpCntpbnQgTjtjaGFyIGFycls1MF07CmludCBjb3VudD0wOwppbnQgbjsKc2NhbmYoIiVpIiwmTik7CmludCBrOwpmb3Ioaz0wO2s8TjtrKyspCnsKc2NhbmYoIiVzIiwmYXJyKTsKaW50IGxlbmd0aD1zdHJsZW4oYXJyKTsKaW50IGk7CmZvcihpPTA7aTxsZW5ndGg7aSsrKQp7CQpjaGFyIHg9YXJyW2ldOwpwdXNoKHgpOwp9CmludCBqOwpjaGFyIHlbNTBdOwpmb3Ioaj0wO2o8bGVuZ3RoO2orKykKewp5W2pdPXBvcCgpO30KZm9yKG49MDtuPGxlbmd0aDtuKyspCntpZihhcnJbbl09PXlbbl0pewpjb3VudCsrO319CmlmKGNvdW50PT1sZW5ndGgpCntwcmludGYoIjFcbiIpO30KZWxzZXtwcmludGYoIjBcbiIpOwp9Cn0KCnJldHVybigwKTsKfQ==