{"raw_statement":[{"iden":"statement","content":"Fox Ciel saw a large field while she was on a bus. The field was a _n_ × _m_ rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.\n\nAfter seeing the field carefully, Ciel found that the crop plants of each cell were planted in following procedure:\n\n*   Assume that the rows are numbered 1 to _n_ from top to bottom and the columns are numbered 1 to _m_ from left to right, and a cell in row _i_ and column _j_ is represented as (_i_, _j_).\n*   First, each field is either cultivated or waste. Crop plants will be planted in the cultivated cells in the order of (1, 1) → ... → (1, _m_) → (2, 1) → ... → (2, _m_) → ... → (_n_, 1) → ... → (_n_, _m_). Waste cells will be ignored.\n*   Crop plants (either carrots or kiwis or grapes) will be planted in each cell one after another cyclically. Carrots will be planted in the first cell, then kiwis in the second one, grapes in the third one, carrots in the forth one, kiwis in the fifth one, and so on.\n\nThe following figure will show you the example of this procedure. Here, a white square represents a cultivated cell, and a black square represents a waste cell.\n\n<center>![image](https://espresso.codeforces.com/34487db5d350148e3854d99a458d8b58cef6dc91.png)</center>Now she is wondering how to determine the crop plants in some certain cells."},{"iden":"input","content":"In the first line there are four positive integers _n_, _m_, _k_, _t_ (1 ≤ _n_ ≤ 4·104, 1 ≤ _m_ ≤ 4·104, 1 ≤ _k_ ≤ 103, 1 ≤ _t_ ≤ 103), each of which represents the height of the field, the width of the field, the number of waste cells and the number of queries that ask the kind of crop plants in a certain cell.\n\nFollowing each _k_ lines contains two integers _a_, _b_ (1 ≤ _a_ ≤ _n_, 1 ≤ _b_ ≤ _m_), which denotes a cell (_a_, _b_) is waste. It is guaranteed that the same cell will not appear twice in this section.\n\nFollowing each _t_ lines contains two integers _i_, _j_ (1 ≤ _i_ ≤ _n_, 1 ≤ _j_ ≤ _m_), which is a query that asks you the kind of crop plants of a cell (_i_, _j_)."},{"iden":"output","content":"For each query, if the cell is waste, print _Waste_. Otherwise, print the name of crop plants in the cell: either _Carrots_ or _Kiwis_ or _Grapes_."},{"iden":"examples","content":"Input\n\n4 5 5 6\n4 3\n1 3\n3 3\n2 5\n3 2\n1 3\n1 4\n2 3\n2 4\n1 1\n1 1\n\nOutput\n\nWaste\nGrapes\nCarrots\nKiwis\nCarrots\nCarrots"},{"iden":"note","content":"The sample corresponds to the figure in the statement."}],"translated_statement":[{"iden":"statement","content":"Fox Ciel 在公交车上看到一块广阔的田野。这块田野是一个 #cf_span[n × m] 的矩形，被划分为 #cf_span[1 × 1] 的单元格。一些单元格是荒地，其余每个单元格都种植了作物：胡萝卜、猕猴桃或葡萄。\n\n在仔细观察田野后，Ciel 发现每个单元格中的作物是按照以下过程种植的：\n\n下图展示了该过程的一个示例。其中，白色方块表示已耕种的单元格，黑色方块表示荒地单元格。\n\n现在她想知道如何确定某些特定单元格中的作物种类。\n\n第一行包含四个正整数 #cf_span[n, m, k, t]（#cf_span[1 ≤ n ≤ 4·104, 1 ≤ m ≤ 4·104, 1 ≤ k ≤ 103, 1 ≤ t ≤ 103]），分别表示田野的高度、宽度、荒地单元格的数量以及询问某个单元格作物种类的查询数量。\n\n接下来的 #cf_span[k] 行，每行包含两个整数 #cf_span[a, b]（#cf_span[1 ≤ a ≤ n, 1 ≤ b ≤ m]），表示单元格 #cf_span[(a, b)] 是荒地。保证该部分中不会出现重复的单元格。\n\n接下来的 #cf_span[t] 行，每行包含两个整数 #cf_span[i, j]（#cf_span[1 ≤ i ≤ n, 1 ≤ j ≤ m]），表示一个查询，询问单元格 #cf_span[(i, j)] 中的作物种类。\n\n对于每个查询，如果该单元格是荒地，请输出 _Waste_；否则，请输出该单元格中的作物名称：_Carrots_、_Kiwis_ 或 _Grapes_。\n\n样例对应题面中的图。"},{"iden":"input","content":"第一行包含四个正整数 #cf_span[n, m, k, t]（#cf_span[1 ≤ n ≤ 4·104, 1 ≤ m ≤ 4·104, 1 ≤ k ≤ 103, 1 ≤ t ≤ 103]），分别表示田野的高度、宽度、荒地单元格的数量以及询问某个单元格作物种类的查询数量。接下来的 #cf_span[k] 行，每行包含两个整数 #cf_span[a, b]（#cf_span[1 ≤ a ≤ n, 1 ≤ b ≤ m]），表示单元格 #cf_span[(a, b)] 是荒地。保证该部分中不会出现重复的单元格。接下来的 #cf_span[t] 行，每行包含两个整数 #cf_span[i, j]（#cf_span[1 ≤ i ≤ n, 1 ≤ j ≤ m]），表示一个查询，询问单元格 #cf_span[(i, j)] 中的作物种类。"},{"iden":"output","content":"对于每个查询，如果该单元格是荒地，请输出 _Waste_；否则，请输出该单元格中的作物名称：_Carrots_、_Kiwis_ 或 _Grapes_。"},{"iden":"examples","content":"输入\n4 5 5 6\n4 3\n1 3\n3 3\n2 5\n3 2\n1 3\n1 4\n2 3\n2 4\n1 1\n1 1\n\n输出\nWaste\nGrapes\nCarrots\nKiwis\nCarrots\nCarrots"},{"iden":"note","content":"样例对应题面中的图。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n, m \\in \\mathbb{Z}^+ $ denote the dimensions of the field: $ n $ rows and $ m $ columns.  \nLet $ W \\subseteq \\{1, \\dots, n\\} \\times \\{1, \\dots, m\\} $ be the set of waste cells, with $ |W| = k $.  \nLet $ Q = \\{(i_\\ell, j_\\ell) \\mid \\ell \\in \\{1, \\dots, t\\}\\} $ be the set of $ t $ queries.\n\nThe crop assignment for non-waste cells follows a periodic pattern based on cell coordinates:  \nFor a non-waste cell at position $ (i, j) $, the crop is determined by:  \n$$\n\\text{crop}(i, j) = \n\\begin{cases}\n\\text{Carrots} & \\text{if } (i + j) \\bmod 3 = 0 \\\\\n\\text{Kiwis} & \\text{if } (i + j) \\bmod 3 = 1 \\\\\n\\text{Grapes} & \\text{if } (i + j) \\bmod 3 = 2 \\\\\n\\end{cases}\n$$\n\n**Constraints**  \n1. $ 1 \\le n \\le 4 \\cdot 10^4 $  \n2. $ 1 \\le m \\le 4 \\cdot 10^4 $  \n3. $ 1 \\le k \\le 10^3 $  \n4. $ 1 \\le t \\le 10^3 $  \n5. For each waste cell $ (a, b) \\in W $: $ 1 \\le a \\le n $, $ 1 \\le b \\le m $, and all waste cells are distinct.  \n6. For each query $ (i, j) \\in Q $: $ 1 \\le i \\le n $, $ 1 \\le j \\le m $.\n\n**Objective**  \nFor each query $ (i, j) \\in Q $:  \n- If $ (i, j) \\in W $, output \"Waste\".  \n- Otherwise, output:  \n  - \"Carrots\" if $ (i + j) \\bmod 3 = 0 $,  \n  - \"Kiwis\" if $ (i + j) \\bmod 3 = 1 $,  \n  - \"Grapes\" if $ (i + j) \\bmod 3 = 2 $.","simple_statement":null,"has_page_source":false}