#include <iostream>
using namespace std;

const int MAX_SIZE = 10;

int main() {
	int n, v[MAX_SIZE + 1];
	cin >> n;
	int flag = 1;
	for (int i = 1; i <= n * 2; ++i) {
		if (i <= n) {
			cin >> v[i];
		} else {
			int currentEl;
			cin >> currentEl;
			if (v[i - n] == currentEl) {
				flag = 0;
			}
		}
	}
	if (flag == 0) {
		cout << "NU";
	} else {
		cout << "DA";
	}
	return 0;
}