#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
if (n >= 1000 && n <= 9999)
if (n / 1000 == n % 10)
cout << "DA";
}
else
cout << "NU";
return 0;