#include <iostream>
using namespace std;
int main() {
int a, b, c, d;
// Citim cele patru numere de la tastatură
cin >> a >> b >> c >> d;
// Verificăm dacă b este multiplu de a
if (b % a != 0) {
cout << "NU" << endl;
return 0;
}
// Verificăm dacă c este multiplu de b
if (c % b != 0) {
cout << "NU" << endl;
return 0;
}
// Verificăm dacă d este multiplu de c
if (d % c != 0) {
cout << "NU" << endl;
return 0;
}
// Calculăm rapoartele
int r1 = b / a;
int r2 = c / b;
int r3 = d / c;
// Verificăm dacă rapoartele sunt egale
if (r1 != r2) {
cout << "NU" << endl;
return 0;
}
if (r2 != r3) {
cout << "NU" << endl;
return 0;
}
// Dacă toate condițiile sunt îndeplinite
cout << "DA" << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICBpbnQgYSwgYiwgYywgZDsKICAgIAogICAgLy8gQ2l0aW0gY2VsZSBwYXRydSBudW1lcmUgZGUgbGEgdGFzdGF0dXLEgwogICAgY2luID4+IGEgPj4gYiA+PiBjID4+IGQ7CgogICAgLy8gVmVyaWZpY8SDbSBkYWPEgyBiIGVzdGUgbXVsdGlwbHUgZGUgYQogICAgaWYgKGIgJSBhICE9IDApIHsKICAgICAgICBjb3V0IDw8ICJOVSIgPDwgZW5kbDsKICAgICAgICByZXR1cm4gMDsKICAgIH0KCiAgICAvLyBWZXJpZmljxINtIGRhY8SDIGMgZXN0ZSBtdWx0aXBsdSBkZSBiCiAgICBpZiAoYyAlIGIgIT0gMCkgewogICAgICAgIGNvdXQgPDwgIk5VIiA8PCBlbmRsOwogICAgICAgIHJldHVybiAwOwogICAgfQoKICAgIC8vIFZlcmlmaWPEg20gZGFjxIMgZCBlc3RlIG11bHRpcGx1IGRlIGMKICAgIGlmIChkICUgYyAhPSAwKSB7CiAgICAgICAgY291dCA8PCAiTlUiIDw8IGVuZGw7CiAgICAgICAgcmV0dXJuIDA7CiAgICB9CgogICAgLy8gQ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