시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB99504455.000%

문제

A string $t$ is a Cyclic Substring of a string $s$ if there is some rotation of $s$ such that $t$ is a substring of that rotation of $s$.

For example, if $s$ is fatcat, then atc and atf are both Cyclic Substrings of $s$. However, act is not a Cyclic Substring of $s$.

A string $s$ is Internally Reversibly Cyclic if, for every proper substring $t$ of $s$, the reverse of $t$ is a Cyclic Substring of $s$.

Given a string, determine if it is Internally Reversibly Cyclic.

입력

The single line of input contains a string $s$ ($1 \le |s| \le 1{,}000$, $s \in \{\texttt{a}-\texttt{z}\}^*$)

출력

Output a single integer, which is $1$ if $s$ is Internally Reversibly Cyclic, $0$ otherwise.

예제 입력 1

ccca

예제 출력 1

1

예제 입력 2

eeaafbddfaa

예제 출력 2

0