{"raw_statement":[{"iden":"statement","content":"Everybody knows video game called \"Snake\". Martynas is developing an upgraded version of the original – \"Snake++\".\n\nThis is the game mechanics: \n\nAn example of snake's, whose starting length is 4, movement is showed in the following image (black squares are obstacles, gray squares are snake, black dot is food). In the fourth step snake have came out of the pit (you can see 4 segments of snake). \n\n\n\nMartynas has generated some fields. The problem is that some fields are too small — snake cannot leave the pit without hitting the wall or itself. Your job is to find if the field is too small or not.\n\nThe first line contains the number of test cases _T_ (T ≤ 50). In the first line of every test case there are integers _n_, _m_ and _k_ (3 ≤ n, m ≤ 10, 2 ≤ k ≤ 5) – the height of the field, the width of the field and the starting length of the snake. In every following _n_ lines there are _m_ symbols: 'x' for starting pit, '#' for obstacle, little letter 'o' for food and dot '.' for unoccupied square. \n\nFor each test case output one line containing “_Case #tc: fit_”, where _tc_ is the number of the test case (starting from 1) and _fit_ is text \"Fits perfectly!\" (without quotes) if snake can leave the pit and \"Oh no, snake's too fat!\" otherwise.\n\n"},{"iden":"input","content":"The first line contains the number of test cases _T_ (T ≤ 50). In the first line of every test case there are integers _n_, _m_ and _k_ (3 ≤ n, m ≤ 10, 2 ≤ k ≤ 5) – the height of the field, the width of the field and the starting length of the snake. In every following _n_ lines there are _m_ symbols: 'x' for starting pit, '#' for obstacle, little letter 'o' for food and dot '.' for unoccupied square. "},{"iden":"output","content":"For each test case output one line containing “_Case #tc: fit_”, where _tc_ is the number of the test case (starting from 1) and _fit_ is text \"Fits perfectly!\" (without quotes) if snake can leave the pit and \"Oh no, snake's too fat!\" otherwise."},{"iden":"examples","content":"Input23 5 5#####.x#..###.#3 5 5#####.x#o.###.#OutputCase #1: Fits perfectly!Case #2: Oh no, snake's too fat!"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ T $ be the number of test cases.  \nFor each test case:  \n- Let $ N \\in \\mathbb{Z}^+ $ be the number of vertices in a directed rooted tree, with $ 1 \\leq N \\leq 10^5 $.  \n- Let $ V = \\{1, 2, \\dots, N\\} $ be the vertex set, where vertex $ 1 $ is the root.  \n- Let $ E \\subseteq V \\times V $ be the set of directed edges (parent → child).  \n- Let $ \\text{parent}(v) $ denote the parent of vertex $ v \\neq 1 $, and $ \\text{children}(v) $ denote the set of direct children of $ v $.  \n- Let $ \\text{preorder}(v) $ denote the pre-order traversal index of vertex $ v $, assigned during a DFS starting at the root.  \n\nLet $ Q \\in \\mathbb{Z}^+ $ be the number of queries, with $ 1 \\leq Q \\leq 10^5 $.  \nEach query is one of two types:  \n- **Type 1**: Given vertex $ u $, update the value of vertex $ u $ to $ x $ (i.e., assign $ \\text{val}[u] \\gets x $).  \n- **Type 2**: Given vertex $ u $, compute the sum of values of all vertices in the subtree rooted at $ u $, under pre-order indexing.  \n\nLet $ \\text{val}: V \\to \\mathbb{Z} $ be the value array associated with vertices.  \n\n**Constraints**  \n1. $ 1 \\leq T \\leq 10 $  \n2. For each test case:  \n   - $ 1 \\leq N \\leq 10^5 $  \n   - $ 1 \\leq Q \\leq 10^5 $  \n   - Initial values $ \\text{val}[v] $ are given (not specified, assumed arbitrary integers)  \n   - Tree is connected and rooted at vertex $ 1 $, with $ N-1 $ edges.  \n\n**Objective**  \nFor each query of type 2 on vertex $ u $, output:  \n$$\n\\sum_{v \\in \\text{subtree}(u)} \\text{val}[v]\n$$  \nwhere $ \\text{subtree}(u) $ is the set of all vertices reachable from $ u $ via directed edges (including $ u $ itself).  \n\n*(Note: Pre-order traversal is defined for structural context but does not alter the subtree sum definition.)*","simple_statement":"You are given a rooted tree with N nodes (N ≤ 10^5), where node 1 is the root. You must handle Q queries (Q ≤ 10^5) of two types:\n\n1. Update: Change the value of a node.\n2. Query: Find the sum of values in the subtree of a node, using pre-order traversal order.\n\nFor each query of type 2, output the answer.","has_page_source":false}