#K86277. Interesting Titles Classification

    ID: 36829 Type: Default 1000ms 256MiB

Interesting Titles Classification

Interesting Titles Classification

You are given a list of book titles. For each title, determine if it is "Interesting" or "Boring". A title is considered Interesting if and only if it contains at least one substring of length 3 that forms a palindrome. In other words, there must exist an index (i) (with (0 \le i \le n-3)) such that for the substring (s[i]s[i+1]s[i+2]), the condition (s[i] = s[i+2]) holds. Otherwise, the title is classified as "Boring".

For example, given the title "abcba", the substring "abc" (where a = 'a' and c = 'c') is not a palindrome, but the substring "bcb" is, making the title Interesting.

inputFormat

The input is read from standard input (stdin). The first line contains an integer (N) denoting the number of book titles. Each of the following (N) lines contains one book title.

outputFormat

For each book title, output a single line containing either "Interesting" or "Boring" according to the classification rule.## sample

3
abcba
abcdefg
xyzyx
Interesting

Boring Interesting

</p>