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_ (_a_ ≠ _b_, 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.
[samples]
## 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.
Vasya 这位程序员住在编程地铁支线的中间。他有两个女朋友:Dasha 和 Masha,她们分别住在支线的两端,彼此都不知道对方的存在。
当 Vasya 有空闲时间时,他会去拜访其中一位女朋友。他会在某个时刻进入地铁,等待第一班列车到来,然后乘坐它直达支线尽头,去见对应的女友。然而,列车的发车频率不同:开往 Dasha 方向的列车每 #cf_span[a] 分钟一班,而开往 Masha 方向的列车每 #cf_span[b] 分钟一班。如果两班列车同时到达,Vasya 会选择发车频率较低的方向,即去往列车发车频率更低的女友(见第三组样例的说明)。
我们知道,列车在 Vasya 出现之前就已经开始运行了。也就是说,列车时刻表满足存在某个时刻,两班列车同时到达。
请帮助 Vasya 计算他更常去哪位女朋友那里。
第一行包含两个整数 #cf_span[a] 和 #cf_span[b](#cf_span[a ≠ b, 1 ≤ a, b ≤ 106])。
如果 Vasya 更常去 Dasha 那里,请输出 "_Dasha_";如果更常去 Masha 那里,请输出 "_Masha_";如果去两人的频率相同,请输出 "_Equal_"。
让我们看第三组样例。假设列车在时间 0 开始运行。显然,列车到达的时刻将以周期 6 重复。因此,只需证明:如果 Vasya 在区间 #cf_span[(0, 6]] 内的任意时刻进入地铁,他去两位女友的频率是相等的。
如果他在 0 到 2 分钟之间进入地铁,他会乘坐在第 2 分钟到达的列车去 Dasha。
如果他在 2 到 3 分钟之间进入地铁,他会乘坐在第 3 分钟到达的列车去 Masha。
如果他在 3 到 4 分钟之间进入地铁,他会乘坐在第 4 分钟到达的列车去 Dasha。
如果他在 4 到 6 分钟之间进入地铁,他会等待两班列车在第 6 分钟同时到达,并因 Masha 方向的列车发车频率更低而选择去 Masha。
总计,Masha 和 Dasha 各获得三分钟的时间,因此 Vasya 去两位女朋友的频率是相等的。
## Input
第一行包含两个整数 #cf_span[a] 和 #cf_span[b](#cf_span[a ≠ b, 1 ≤ a, b ≤ 106])。
## Output
如果 Vasya 更常去 Dasha 那里,请输出 "_Dasha_";如果更常去 Masha 那里,请输出 "_Masha_";如果去两人的频率相同,请输出 "_Equal_"。
[samples]
## Note
让我们看第三组样例。假设列车在时间 0 开始运行。显然,列车到达的时刻将以周期 6 重复。因此,只需证明:如果 Vasya 在区间 #cf_span[(0, 6]] 内的任意时刻进入地铁,他去两位女友的频率是相等的。如果他在 0 到 2 分钟之间进入地铁,他会乘坐在第 2 分钟到达的列车去 Dasha。如果他在 2 到 3 分钟之间进入地铁,他会乘坐在第 3 分钟到达的列车去 Masha。如果他在 3 到 4 分钟之间进入地铁,他会乘坐在第 4 分钟到达的列车去 Dasha。如果他在 4 到 6 分钟之间进入地铁,他会等待两班列车在第 6 分钟同时到达,并因 Masha 方向的列车发车频率更低而选择去 Masha。总计,Masha 和 Dasha 各获得三分钟的时间,因此 Vasya 去两位女朋友的频率是相等的。
Let $ a, b \in \mathbb{Z}^+ $, $ a \ne b $, denote the train intervals (in minutes) to Dasha and Masha respectively.
Let $ T = \mathrm{lcm}(a, b) $ be the period of the combined train schedule.
Within one period $ [0, T) $, the trains to Dasha arrive at times $ \{0, a, 2a, \dots\} $, and to Masha at $ \{0, b, 2b, \dots\} $.
For any arrival time $ t \in [0, T) $, Vasya takes the next train after $ t $. Define the waiting time to the next Dasha train as $ d(t) = \min\{ x \geq 0 : t + x \equiv 0 \pmod{a} \} $, and similarly $ m(t) $ for Masha.
Vasya chooses:
- Dasha if $ d(t) < m(t) $,
- Masha if $ m(t) < d(t) $,
- Masha if $ d(t) = m(t) $ (since the lower-frequency train is chosen in case of tie).
Define the function $ f(t) $ as:
$$
f(t) =
\begin{cases}
\text{Dasha} & \text{if } d(t) < m(t), \\
\text{Masha} & \text{if } d(t) \geq m(t).
\end{cases}
$$
The total time per period $ T $ that Vasya goes to Dasha is:
$$
\mu_D = \int_0^T \mathbf{1}_{\{d(t) < m(t)\}} \, dt
$$
Similarly, the time for Masha is:
$$
\mu_M = \int_0^T \mathbf{1}_{\{d(t) \geq m(t)\}} \, dt
$$
Since the schedule is periodic and piecewise linear, the integrals reduce to summing lengths of intervals in $ [0, T) $ where the condition holds.
We compute:
- $ \mu_D = \text{measure of } \{ t \in [0, T) : d(t) < m(t) \} $
- $ \mu_M = T - \mu_D $
Then:
- If $ \mu_D > \mu_M $, output "Dasha"
- If $ \mu_M > \mu_D $, output "Masha"
- If $ \mu_D = \mu_M $, output "Equal"
Equivalently, since $ \mu_D + \mu_M = T $, compare $ \mu_D $ to $ T/2 $.
Thus, the problem reduces to computing the measure of the set $ \{ t \in [0, T) : d(t) < m(t) \} $, where $ d(t) = (a - t \bmod a) \bmod a $, $ m(t) = (b - t \bmod b) \bmod b $, and $ T = \mathrm{lcm}(a,b) $.