4066: 火车

内存限制:256 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:8 通过:3

题目描述

    程序员Vasya住在“编程”地铁分店的中间。他有两个女朋友:达莎和玛莎,她们住在树枝的两端,每个人都不知道另一个人的存在。 

    当Vasya有空闲时间的时候,他会去找他的一个女朋友。他在某个时候下到地铁里,等第一辆车来,然后骑上它到相应的女孩的分支的尽头。然而,火车的运行频率不同:每隔一分钟就有一辆火车开往达莎的方向,但每隔b分钟就有一辆火车开往玛莎的方向。如果两列火车同时靠近,Vasya会向火车行驶频率较低的方向走去,也就是说,向火车行驶频率较低的女孩走去(见第三个样本的注释) 

    我们知道,在瓦西娅出现之前,两列火车开始同时行驶。也就是说,火车时刻表是这样的,在某个时刻两列火车同时到达。 

    帮Vasya数一下他会更经常去找哪个女朋友。





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.
Input
The first line contains two integers a and b (ab,1≤a,b≤106).
Output
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.
Note
Let's take a look at the third sample. Let the trains start to go at the zero moment of time. It is clear that the moments of the trains' arrival will be periodic with period 6. That's why it is enough to show that if Vasya descends to the subway at a moment of time inside the interval (0,6], he will go to both girls equally often. 
If he descends to the subway at a moment of time from 0 to 2, he leaves for Dasha on the train that arrives by the second minute. 
If he descends to the subway at a moment of time from 2 to 3, he leaves for Masha on the train that arrives by the third minute. 
If he descends to the subway at a moment of time from 3 to 4, he leaves for Dasha on the train that arrives by the fourth minute. 
If he descends to the subway at a moment of time from 4 to 6, he waits for both trains to arrive by the sixth minute and goes to Masha as trains go less often in Masha's direction. 
In sum Masha and Dasha get equal time − three minutes for each one, thus, Vasya will go to both girlfriends equally often. 

输入格式

第一行包含两个整数ab (ab,1a,b10^6)

输出格式

如果Vasya会更频繁地去找Dasha,就写“Dasha”,如果他会更频繁地去找Masha,就写“Masha”,如果他会以相同的频率去找两个女朋友,就写“Equal”。

 

Examples
Input
3 7
Output
Dasha
Input
5 3
Output
Masha
Input
2 3
Output
Equal


样例解释: 

    让我们看一下第三个示例。让火车在零点开始行驶。很明显,火车到达的时刻将是周期性的,周期为6。这就是为什么足以表明,如果Vasya在间隔(0,6]内的某个时刻下降到地铁,他会同样频繁地去找两个女孩。 

    如果他在0到2的某个时刻下降到地铁,他就会乘坐第二分钟到达的火车前往Dasha。 

    如果他在2点到3点的某个时刻下降到地铁,他就会乘坐第三分钟到达的火车去找Masha。 

    如果他在3点到4点的某个时间下地铁,他就会乘坐4分钟到达的火车前往Dasha。 

    如果他在4点到6点的某一时刻去地铁,他会在第6分钟前等两列火车到达,然后去Masha,因为Masha方向的火车很少。总的来说,Masha和Dasha的时间是一样的,每人3分钟,因此,Vasya去找两个女朋友的次数是一样多的。 


输入样例 复制

3 7

输出样例 复制

Dasha

数据范围与提示