题库练习 Trains
← 上一题 下一题 →

A8076 | Trains

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

Vasya the programmer lives in the middle of the Programming subway branch. He has two girlfriends: Dasha and Masha, who live at the different ends of the branch, each one is unaware of the other one's existence.

When Vasya has some free time, he goes to one of his girlfriends. He descends into the subway at some time, waits the first train to come and rides on it to the end of the branch to the corresponding girl. However, the trains run with different frequencies: a train goes to Dasha's direction every $a$ minutes, but a train goes to Masha's direction every $b$ minutes. If two trains approach at the same time, Vasya goes toward the direction with the lower frequency of going trains, that is, to the girl, to whose directions the trains go less frequently (see the note to the third sample).

We know that the trains begin to go simultaneously before Vasya appears. That is the train schedule is such that there exists a moment of time when the two trains arrive simultaneously.

Help Vasya count to which girlfriend he will go more often.

输入格式

The first line contains two integers $a$ and $b$ ( $a≠b,1<=a,b<=10^{6}$ ).

输出格式

Print "Dasha" if Vasya will go to Dasha more frequently, "Masha" if he will go to Masha more frequently, or "Equal" if he will go to both girlfriends with the same frequency.

输入输出样例

输入 #1
3 7
输出 #1
Dasha
输入 #2
5 3
输出 #2
Masha
输入 #3
2 3
输出 #3
Equal
C++ 编辑器
输入
输出