Stripes Stripes is a two player game played upon a number line using rectangular strips of plastic in three colors: red, green, and blue. All strips of the same color have the same length; red strips have length R (1 <= R <= 1,000), green strips have length G (1 <= G <= 1,000), and blue strips have length B (1 <= B <= 1,000). Players have at their disposal an unlimited pool of stripes of each color. A game board is a number line of length L_j (1 <= L_j < 1,000). Players make their moves by turns. Each move consists of laying a stripe of any color on the number line according to these rules: * The stripe must completely fit on the board * The stripe's left edge must be at an integer * The stripe can not overlap with any other already-played stripe A player who is not able to perform his move in accordance to the game rules loses. Given a set of stripe lengths, read M (1 <= M <= 1,000) number-line lengths L_j and determine whether the first player has a winning strategy for each game. PROBLEM NAME: stripes INPUT FORMAT: * Line 1: Three space-separated integers: R, G, and B * Line 2: A single integer: M * Lines 3..M+2: Line j+2 contains a single integer: L_j SAMPLE INPUT: 1 5 1 3 1 5 6 OUTPUT FORMAT: * Lines 1..M: Line i contains a single integer that represents the determination of first-player-winning strategy for game i: 1 If the first player has a winning strategy on the i-th board 2 otherwise. SAMPLE OUTPUT: 1 1 2