eolymp
bolt
Try our new interface for solving problems
Problems

Barbarian tribes

Barbarian tribes

In a lost land two primitive tribes coexist: Gareds and Kekas. Every summer solstice they meet and compete to decide which tribe will be the favorite of the gods for the rest of the year, following an old ritual: First, a local guru chooses three numbers at random: \textbf{n}, \textbf{m} and \textbf{k}. Afterwards, \textbf{n} Gared maids (in the positions \textbf{1}, \textbf{2}, ..., \textbf{n}) and \textbf{m} Keka maids (in the positions \textbf{n+1}, \textbf{n+2}, ..., \textbf{n+m}) are placed in a circle looking inwards. Then the guru begins to count \textbf{1}, \textbf{2}, ..., \textbf{k} starting at the first Gared maid. When the \textbf{k}-th maid is reached, she is immediately sacrificed to the gods. The guru then counts again \textbf{1}, \textbf{2}, ..., \textbf{k} starting at the maid following the one just sacrificed. Again, the \textbf{k}-th maid reached this way is sacrificed. After every two sacrifices, the second sacrificed maid is replaced by a new maid. In order to decide the tribe of the new maid, the guru looks at the heads of the two maids just killed (nothing else remains of them). If both heads are of the same tribe, the guru calls a Gared maid. If the heads are from different tribes, the guru calls a Keka maid. The process then begins again (counting and sacrificing twice and replacing once) starting to count at the maid following the new maid just added to the circle. Since the number of maids reduces by one after every step (of two sacrifices and one replacement), after \textbf{n + m - 1} steps only one maid remains. According to the tradition, the tribe of the last maid will be the favorite of the gods. (What the guru does to the last maid is something you don't want to know.) Anyway, write a program such that, given \textbf{n}, \textbf{m} and \textbf{k}, writes the name of the fortunate tribe. For example, this is what happens for \textbf{n = m = 3} and \textbf{k = 2} (a "\textbf{G}" denotes a Gared maid and a "\textbf{K}" denotes a Keka maid; the subindexes mark the order the maids enter the circle): 1. Initial content of the circle: \textbf{G_1 G_2 G_3 K_4 K_5 K_6} Starting to count at \textbf{G_1}. First sacrifice: \textbf{G_2}. Second sacrifice: \textbf{K_4} (replaced by \textbf{K_7}). 2. Content of the circle: \textbf{G_1 G_3 K_7 K_5 K_6} Starting to count at \textbf{K_5}. First sacrifice: \textbf{K_6}. Second sacrifice: \textbf{G_3} (replaced by \textbf{K_8}). 3. Content of the circle: \textbf{G_1 K_8 K_7 K_5} Starting to count at \textbf{K_7}. First sacrifice: \textbf{K_5}. Second sacrifice: \textbf{K_8} (replaced by \textbf{G_9}). 4. Content of the circle: \textbf{G_1 G_9 K_7} Starting to count at \textbf{K_7}. First sacrifice: \textbf{G_1}. Second sacrifice: \textbf{K_7} (replaced by \textbf{K_10}). 5. Content of the circle: \textbf{G_9 K_10} Starting to count at \textbf{G_9}. First sacrifice: \textbf{K_10}. Second sacrifice: \textbf{G_9} (replaced by \textbf{K_11}). 6. Final content of the circle: \textbf{K_11} \InputFile Input consists of zero ore more test cases. Each test case consists of a line with three positive integers: \textbf{n}, \textbf{m} and \textbf{k}. You can assume \textbf{1} ≤ \textbf{n} + \textbf{m} ≤ \textbf{2000} and \textbf{1} ≤ \textbf{k} ≤ \textbf{1000}. A test case with \textbf{n = m = k = 0} ends the input and must not be processed. \OutputFile For every test case, print either "\textbf{Gared}" or "\textbf{Keka}" as convenient.
Time limit 1 second
Memory limit 128 MiB
Input example #1
3 3 2
4 2 2
0 1 7
0 0 0
Output example #1
Keka
Gared
Keka