Character game

Character game

Time Limit: 1.0 s

Memory Limit: 256.0 MB

Description

Mahfuj and Roy is going to play a game which is called character game. Mahfuj loves character 'q' where Roy loves character 'p'. In this game, you are given a string S which contains only character 'p' and 'q'. You need to find out, if the number of occurance 'p' is greater than 'q' then Roy win or the number of occurance 'q' is greater than 'p' then Mahfuj win or both character has equal occurance then Draw.

Input

First line of input takes an integer \(T\) : number of testcases
Each of the next \(T\) testcase takes a string \(S\) : describing the game

1 <= \(T\) <= 10
1 <= \(|S|\) <= 100

Output

Print \(T\) lines : each line should print the winner of the game or "Draw" if there is no winner

Sample

Input Output
3
pqp
qqqp
pppqqq
Roy
Mahfuj
Draw

1st test case, string S = "pqp", occurance of p=2 and q=1. p is greater than q, so Roy wins.

2nd test case , string S = "qqqp", occurance of p=1 and q=3. q is greater than p, so Mahfuj wins.

3rd test case , string S = "pppqqq", occurance of p=3 and q=3. they are equal, so print Draw.

Information

ID
1040
Difficulty
1
Category
Beginners Click to Show
Tags
(None)
# Submissions
65
Accepted
42
Accepted Ratio
65%
Uploaded By

Related

In following contests:

TLE_Headquarters - round #1