#include <iostream>
using namespace std;
int main()
{
int a, b, c, x, cx, prim, nrcif=0, ok=1;
cin>>a>>b>>c>>x;
if(c!=x%10)
ok=0;
if(ok==1)
{
cx=x;
while (cx>0)
{
nrcif++;
prim=cx%10;
cx=cx/10;
}
}
if(nrcif==a && prim==b)
ok=1;
else ok=0;
if(ok==1) cout<<"DA";
else cout<<"NU";
return 0;
}