{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"In a country named **Ajob Desh**, people play a game called **Ajob Game** (or strange game). This game is actually a game of words. The rules for the game are as follows:\n\n1. It\u0027s an **N** player game and players are numbered from **1** to **N**. And the players alternate turns in a circular way. Player 1 starts first. The next turn is for player 2, then player 3 and so on. After the turn for the **N\u003csup\u003eth\u003c/sup\u003e** player, player 1 gets his/her turn again and the same procedure is continued.\n2. In each turn a player has to propose a pair of words. Each of the words should have length **L**, and the words should differ in exactly **M** positions. As their language has **K** alphabetical symbols, a word is a collection of symbols from these **K** alphabets.\n3. The pair of words proposed by a player should differ in exactly **M** positions, meaning there should be exactly **M** positions where the two words have different symbols, and in other positions they have the same symbols. For example, \"ab**c**\" and \"ab**d**\" differ in exactly 1 position, \"a**bc**\" and \"a**ca**\" differ in exactly 2 positions, \"**abc**\" and \"**cab**\" differ in exactly 3 positions.\n4. In each turn, a player has to propose a new pair of words. Two pairs are different if at least one word is different. Note that here pair refers to **unordered pair**. Let **A, B, C** be three different words, then **(A, B)** and **(B, A)** are the same, but **(A, C)** and **(A, B)** are different. For example, if a player already proposed {\"abc\", \"def\"}, then none can propose {\"abc\", \"def\"} or {\"def\", \"abc\"}. But a player can propose {\"abc\", \"fed\"} or {\"abc\", \"abc\"} or {\"pqc\", \"abc\"} etc.\n5. If a player fails to propose a new pair of words, he/she is treated as the loser of the game. And the game ends.\n\nLet **N \u003d 2, K \u003d 2, L \u003d 2, M \u003d 1** and the alphabet is **{\u0027a\u0027, \u0027b\u0027}**. All the words of length 2 are: **{\"aa\", \"ab\", \"ba\", \"bb\"}**. Player 1 chooses pair **{\"aa\", \"ab\"}** (differs in 1 position as **M \u003d 1**) then player 2 chooses pair **{\"ab\", \"bb\"}**. After that player 1 chooses **{\"aa\", \"ba\"}** then player 2 chooses **{\"bb\", \"ba\"}**. And then there is no pair left for player 1, and so, player 1 will lose.\n\nNow, this game is played by **N** players who know this game very well thus they play optimally. You are given **N, K, L** and **M**; you have to find the losing player."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026#8804; 200)**, denoting the number of test cases.\n\nEach case starts with a line containing four integers **N (2 \u0026#8804; N \u0026#8804; 10000), K (1 \u0026#8804; K \u0026#8804; 10\u003csup\u003e9\u003c/sup\u003e), L (1 \u0026#8804; L \u0026#8804; 10\u003csup\u003e5\u003c/sup\u003e)** and **M (0 \u0026#8804; M \u0026#8804; L)**."}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number and the player who loses the game."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\n2 2 2 1\n3 4 3 3\n9 26 8 5\n10 2 2 2\n100 3 2 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 1\nCase 2: 1\nCase 3: 5\nCase 4: 3\nCase 5: 10\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}