Wacław Sierpiński was a Polish mathematician. He decided to construct triangles by repeating the following process.
T.T1, T2, T3, and T4. The left picture below shows this step.T1, T2, and T3. The newly created triangles are named T11, T12, T13, T14, T21, T22, T23, T24, T31, T32, T33, and T34.1, 2, or 3. The resulting fractal is called the Sierpinski triangle.
Triangle A is said to lean on triangle B if B does not contain A, and one whole side of A is part of one side of B. For example, T23 leans on T24 and T4, but not on T2 or T32. If A leans on B, that does not imply that B leans on A.
Given a triangle A in the Sierpinski triangle, find every triangle B that A leans on.
The first line contains the name of triangle A. The name has length at least 2 and at most 50.
Print the name of every triangle that A leans on, one per line. The names may be printed in any order.