In nature, DNA molecules are responsible for the transmission of hereditary information. The structure of DNA is simple and complex at the same time – its molecules are two long polymer strands bonded together in a double helix. Each DNA strand is built based on only four nucleotides: Adenine (A – Adenine), Guanine (G – Guanine), Thymine (T – Thymine), and Cytosine (C – Cytosine). It is customary to encode nucleotides in capital Latin letters and write their sequence as a line. For example: «ACTG».
In the first strand, nucleotides are connected sequentially in any order. Still, the second strand of the helix is built strictly on the principle of complementarity: Adenine always forms a pair with Thymine (A–T or T–A) and Cytosine with Guanine (C–G or G–C). So, a nucleotide located at a particular place in the first strand uniquely defines a nucleotide situated at the same place in the second strand.
For example, if one strand consists of «ACTGTAC» nucleotides, then the second will have the form «TGACATG».
This method of recording information is redundant and, in some places, ambiguous. For example, it may happen that the same sequence of nucleotides occurs in the first strand in one direction, in the second strand – in a different place and in exactly the opposite direction.
Write a program that, based on the sequence of nucleotides in one strand, will determine the longest subsequence of consecutive nucleotides that also occurs in the complementary strand, but in the reverse sequence. The location of the searched subsequence is not important.
The input contains a single line with a length from $$$ 1 $$$ to $$$ 100\,000 $$$ characters. It is guaranteed that the string consists only of the letters «A», «C», «G» and «T».
If the searched sequence does not exist, print $$$0$$$ in a single line. If the sequence exists, indicate its length in the first line, and print the sequence itself as a chain of capital Latin letters in the second line.
If there are multiple solutions print any of them.
AGCT
4 AGCT
AACGTACGTG
8 ACGTACGT
Let's look at the second example. The complementary to the chain «AACGTACGTG» is «TTGCATGCAC». The «ACGTACGT» gene occurs both in the direct «A–ACGTACGT–G» and in the complementary chain «T–TGCATGCA–C», but in the latter it is written backwards.
| Name |
|---|


