#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;
}