#include <iostream>
using namespace std;

int main() {
	int a, b;
	cin >> a>> b;
	while (b > 10) {
		b /= 10;
	}
	
	if (b == a % 10 || b == a / 10 % 10) {
		cout << "DA";
		
	} else {
		cout << "NU";
	}
	return 0;
}