Problem:
Score : 100 points

Problem Statement

Rng is going to a festival.

The name of the festival is given to you as a string S, which ends with FESTIVAL, from input. Answer the question: "Rng is going to a festival of what?" Output the answer.

Here, assume that the name of "a festival of s" is a string obtained by appending FESTIVAL to the end of s.
For example, CODEFESTIVAL is a festival of CODE.

Constraints

9 \leq |S| \leq 50

S consists of uppercase English letters.

S ends with FESTIVAL.

Input

Input is given from Standard Input in the following format:

S

Output

Print the answer to the question: "Rng is going to a festival of what?"

Sample Input 1

CODEFESTIVAL

Sample Output 1

CODE

This is the same as the example in the statement.

Sample Input 2

CODEFESTIVALFESTIVAL

Sample Output 2

CODEFESTIVAL

This string is obtained by appending FESTIVAL to the end of CODEFESTIVAL, so it is a festival of CODEFESTIVAL.

Sample Input 3

YAKINIKUFESTIVAL

Sample Output 3

YAKINIKU

Solution in C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include<iostream>
using namespace std;
char a[500002];
char b[500002];
int main()
{
	int s,ss,sss,n,i,j,k,x,y;
	cin >>n;
	for (i=0;i<n+2;i++)
	{
		b[i]='0';
		a[i]='0';
	}
	for (i=0;i<n;i++)
	{
		cin >>a[i];
		b[i]=a[i];
	}
	x=0;
	y=0;
	sss=0;
	/*a[500001]='0';
	a[500000]='0';
	b[500001]='0';
	b[500000]='0';*/
	for(i=0;i<n+1;i++)
	{
		if (a[i]=='0'&& a[i+1]=='0')
		{
			ss=0;
			s=0;
			for (j=x;j<i;j++)
			{
				if (a[j]=='1')
					s++;
				else
					if (a[j-1]!='0')
					{
						ss+=s;
						a[j+1]='0';
						s=0;
					}
			}
			int ss1=0;
			s=0;
			for (j=i-1;j>=x;j--)
			{
				if (b[j]=='1')
					s++;
				else
					if (b[j+1]!='0')
					{
						ss1+=s;
						b[j-1]='0';
						s=0;
					}
			}
			sss+=max(ss,ss1);
			x=i+2;
		}
	}
	cout <<sss<<endl;
	return 0;
}