Card Game
Practice
3.8 (389 votes)
Easy
Problem
70% Success 1234 Attempts 20 Points 2s Time Limit 256MB Memory 1024 KB Max Code

Devu and Churu loves to play with cards alot. Today, they both have a deck of playing cards. Each deck consists of N playing cards numbered from 1 to N. Devu calls his sequence of cards S whereas Churu calls his sequence of cards P and also it is known that S != P.

In order to play with these cards they both have come up with the following interesting game. In their respective turn, they will choose some pair of integers i and j such that i != j and 1 <= i, j<= N and will swap the cards present at ith and jth position in their respective sequence. If at any point of time both the sequence S and P becomes equal i.e Si = Pi for all i from [1, N] , Devu wins the game otherwise the game will last long for many years and devu will surely gonna die before it actually ends and therefore, the winner will be Churu. Both players will make moves alternatively and will play optimally i.e Devu will try to make both sequence equal whereas Churu will try his best to stop him.

Devu being smart will choose to play game only if he is going to win it for the given sequence of S and P and therefore, he asked you to tell him the winner for a given game.

Given original sequences S and P consisting of N playing cards and the player who will move first. Can you find the winner of the game ?


Input

First line of input contains a single integer T denoting the number of test cases. Each test case consists of 4 lines only. First line of each test case contains a single integer N denoting the number of playing cards. Second line of each test case contains N space separated integers denoting sequence S. Third line of each test case contains N space separated integers denoting sequence P. Fourth line of each test case contains the name of player who will move first.

Output

For each test case, Print "Devu" if Devu wins the game. Print "Churu" otherwise.

Constraints

  • 1 ≤ T ≤ 105
  • 2 ≤ N ≤ 105
  • Sum of N over all test cases does not exceed 5 * 105

Scoring

  • Sum of N over all test cases does not exceed 102 ( 20 % test files )
  • Sum of N over all test cases does not exceed 103 ( 50 % test files )
  • Sum of N over all test cases does not exceed 5 * 105 ( 100 % test files )

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
28 votes
Tags:
Ad-HocApprovedBasic ProgrammingEasyHash MapsOpen
Points:30
402 votes
Tags:
Brute-force searchEasy-MediumGreedy algorithm
Points:20
9 votes
Tags:
EasyMath