{"raw_statement":[{"iden":"statement","content":"In order to kill time, you devised a little game. The wetland is represented by an $N times N$ grid made of 3 types of squares: firm ground, wet zone, and protected zone.\n\nConnected wet zone squares form wet areas, which are maximal sets of wet zone squares such that we can go from any square of the area to any other square of the area by a path of connected wet zone squares. Two squares are considered connected when they share one edge, so that squares not on the border of the grid are connected to 4 other squares. Each wet area must be connected to both the left and right sides of the grid, and does not contain more than $2 N$ wet zone squares. Two wet zone squares that belong to two different wet areas will always be at distance at least 3 from each other, the distance being counted by moving horizontally or vertically on the grid. For example, in the two examples below, the blue squares are at distance 3 from one another. \n\nOne after the other, you and your friend will each take turns placing a camera on the wetland with the following constraints: \n\nThe first player who cannot place a camera anymore loses the game. Assuming both players play optimally, will the first player win or lose?\n\nThe input consists of the following lines: \n\n*Limits*\n\nThe input satisfies $1 <= N <= 10$.\n\nThe four words \"First player will win\" if the first player wins the game provided both players play optimally, or \"Second player will win\" otherwise.\n\n*Sample Explanation 1*\n\nThe first player can place a camera in three possible places: if he places a camera in the left or right position, then the second player can place one in the other position and wins the game. On the other hand, if the first player places a camera in the middle, the second player cannot place another camera and loses.\n\n"},{"iden":"input","content":"The input consists of the following lines:   on the first line, the integer $N$;  on the next $N$ lines, a string representing a row of the grid: \"*\" represents a wet zone square, \".\" represents a firm ground square and \"x\" represents a protected square. *Limits*The input satisfies $1 <= N <= 10$."},{"iden":"output","content":"The four words \"First player will win\" if the first player wins the game provided both players play optimally, or \"Second player will win\" otherwise."},{"iden":"examples","content":"Input3\n...\n...\n***\nOutputFirst player will win\nInput10\n**********\n*.x.*.....\n*...*.....\n*****.....\n..........\n..........\nxx******..\n***x...*..\n..*...x*.x\n..********\nOutputSecond player will win\n"},{"iden":"note","content":"*Sample Explanation 1*The first player can place a camera in three possible places: if he places a camera in the left or right position, then the second player can place one in the other position and wins the game. On the other hand, if the first player places a camera in the middle, the second player cannot place another camera and loses."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n, m \\in \\mathbb{Z}^+ $ denote the number of boxes and number of moves, respectively.  \nLet $ A = (A_1, A_2, \\dots, A_n) \\in \\mathbb{Z}^n $ be the initial number of balls in each box.  \nLet $ S = (S_1, S_2, \\dots, S_n) \\in \\{0,1\\}^n $ be the initial state of each box, where $ S_i = 1 $ if box $ i $ is open, $ 0 $ if closed.  \n\nLet $ M = (m_1, m_2, \\dots, m_m) $ be a sequence of $ m $ moves, each of type:  \n- **turon**: $ (L, R) $ — flip the state $ S_i \\leftarrow 1 - S_i $ for all $ i \\in [L, R] $.  \n- **puto**: $ (L, R, v) $ — add $ v $ to $ A_i $ for all $ i \\in [L, R] $ where $ S_i = 1 $.  \n- **taho**: $ (L, R) $ — compute $ \\sum_{i=L}^{R} A_i \\cdot S_i $.  \n\n**Constraints**  \n1. $ 1 \\le n, m \\le 3 \\cdot 10^5 $  \n2. $ 1 \\le A_i, v \\le 10^6 $  \n3. $ 1 \\le L \\le R \\le n $ for all moves  \n4. $ S_i \\in \\{0,1\\} $ for all $ i $, updated dynamically  \n\n**Objective**  \nFor each taho move $ (L, R) $, output:  \n$$\n\\sum_{i=L}^{R} A_i \\cdot S_i\n$$","simple_statement":"Jason has n boxes, each with some balls and either open or closed. He does three types of operations:\n\n1. **turon L R**: Flip the state of all boxes from L to R (open ↔ closed).\n2. **puto L R v**: Add v balls to every *open* box from L to R.\n3. **taho L R**: Sum the total balls in all boxes from L to R (open or closed).\n\nGiven initial ball counts and open/closed states, process all m operations and output the result of each taho query.","has_page_source":false}