You must be familiar with binary trees and all their operations, but this problem deals with a less popular structure, which I shall call myTree. There are three possible organizations of a myTree:
All internal (non-terminal) nodes have two or three children, although some may be empty. One way to represent such a tree is to use level-order traversal, starting at the root node, with the content of each node enclosed in parentheses. An empty tree is represented by a pair of parentheses that encloses nothing. The following figure demonstrates an example of such a tree, along with its representation, with values in the nodes being uppercase characters chosen in the range of ``A" to ``Z", inclusive.

A lecturer of ``Data Structures 101" likes to test her students understanding of the myTree structure by asking them to identify all possible ways to assign a missing value in a given myTree.
Examples of such a question would be:
Your task is to write a program to answer such a question.
The input contains descriptions of a number of myTree structures to be processed. The information for each tree is given in a single line as a series of properly matched parentheses. Each pair of matched parentheses encloses zero, one, or two characters selected from uppercase letters in the range of ``A" to ``Z" and ``?". Each line contains exactly one ``?". The selected characters and parentheses are separated by single spaces.
The input is terminated by a line of a set of matched parentheses, which encloses a zero, for which no output is to be produced.
For each input tree the output is a single line with: