#include <iostream>
using namespace std;
const int TEN = 10;
int main() {
int a, b, c, x, countNoDigit = 1;
cin >> a >> b >> c >> x;
int firstDigit = x;
int lastDigit = x % TEN;
while (firstDigit >= TEN) {
++countNoDigit;
firstDigit /= TEN;
}
if (a == countNoDigit && b == firstDigit && c == lastDigit) {
cout << "DA";
} else {
cout << "NU";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY29uc3QgaW50IFRFTiA9IDEwOwoKaW50IG1haW4oKSB7CiAgICBpbnQgYSwgYiwgYywgeCwgY291bnROb0RpZ2l0ID0gMTsKICAgIGNpbiA+PiBhID4+IGIgPj4gYyA+PiB4OwogICAgaW50IGZpcnN0RGlnaXQgPSB4OwogICAgaW50IGxhc3REaWdpdCA9IHggJSBURU47CiAgICB3aGlsZSAoZmlyc3REaWdpdCA+PSBURU4pIHsKICAgIAkrK2NvdW50Tm9EaWdpdDsKICAgICAgICBmaXJzdERpZ2l0IC89IFRFTjsKICAgIH0KICAgIGlmIChhID09IGNvdW50Tm9EaWdpdCAmJiBiID09IGZpcnN0RGlnaXQgJiYgYyA9PSBsYXN0RGlnaXQpIHsKICAgICAgICBjb3V0IDw8ICJEQSI7CiAgICB9IGVsc2UgewogICAgICAgIGNvdXQgPDwgIk5VIjsKICAgIH0KICAgIHJldHVybiAwOwp9