CF87A Trains

题目描述

程序员 Vasya 住在 Programming 地铁支线的中间。他有两个女朋友:Dasha 和 Masha,她们分别住在这条支线的两个不同端点,而且彼此不知道对方的存在。 当 Vasya 有空闲时间时,他会去其中一个女朋友那里。他会在某个时刻进入地铁站,等待第一列到来的列车,然后乘坐它到该支线的终点,去找对应的女朋友。然而,两条方向的列车运行频率不同:每 $a$ 分钟会有一列列车开往 Dasha 的方向;每 $b$ 分钟会有一列列车开往 Masha 的方向。 如果两列列车同时到达,那么 Vasya 会选择 发车频率更低的方向,也就是说,他会去那个列车发车间隔更长(列车更少) 的方向对应的女朋友那里(见第三个样例说明)。 已知在 Vasya 出现之前,两种列车的发车时间是同时开始的。也就是说,列车时刻表满足:存在某个时刻,两列列车会同时到达。 请帮助 Vasya 计算:他更经常去哪个女朋友那里。

输入格式

第一行包含两个整数 a 和 b($a\neq b,1

输出格式

一行,“Dasha”“Masha”或“Equal”。

说明/提示

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.