406413: GYM102397 G Super Weird Game

Memory Limit:1024 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

G. Super Weird Gametime limit per test1.5 secondsmemory limit per test1024 megabytesinputstandard inputoutputstandard output

Bashar and Mahmoud felt bored so they decided to play another game.

In this game each player has an array of size $$$n$$$ $$$(1 \leq n \leq 10^5)$$$ consists of elements of values between 1 and $$$10^5$$$.

Ayoub thinks that the pair $$$(i, j)$$$ is a good pair if all of the following conditions hold:

  1. i < j.
  2. $$$a_i$$$ + $$$a_j$$$ = $$$k$$$.

The player who has the greater number of good pairs wins.

If you know the value of $$$k$$$, and the value of the elements in Bashar's and Mahmoud's array, can you determine the winner ?

Input

The first line of input contains 2 integers $$$n$$$, $$$k$$$, $$$(1 \leq n,k \leq 10^5)$$$, which denotes the size of the arrays Ayoub's random number.

The Second line of input contains $$$n$$$ integers $$$m_1$$$,$$$m_2$$$,...,$$$m_n$$$ $$$(1 \leq m_i \leq 10^5)$$$, denotes Mahmoud's array.

The Tired line of input contains $$$n$$$ integers $$$b_1$$$,$$$b_2$$$,...,$$$b_n$$$ $$$(1 \leq b_i \leq 10^5)$$$, denotes Bashar's array.

Output

if Mahmoud wins print $$$"Mahmoud"$$$, if Bashar wins print $$$"Bashar"$$$, otherwise print $$$"Draw"$$$.

ExampleInput
7 3
1 1 2 3 4 1 2
2 2 2 1 1 1 2
Output
BASHAR

加入题单

上一题 下一题 算法标签: