#include <iostream>
using namespace std;
const int MAX_SIZE = 10;
int main() {
int n, fLine[MAX_SIZE + 1], sLine[MAX_SIZE + 1];
cin >> n;
for (int i = 1; i <= n; ++i) {
cin >> fLine[i];
}
int goodLine = 0;
for (int i = 1; i <= n; ++i) {
cin >> sLine[i];
if (fLine[i] != sLine[i]) {
++goodLine;
}
}
if (goodLine == n) {
cout << "DA";
} else {
cout << "NU";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY29uc3QgaW50IE1BWF9TSVpFID0gMTA7CgppbnQgbWFpbigpIHsKCWludCBuLCBmTGluZVtNQVhfU0laRSArIDFdLCBzTGluZVtNQVhfU0laRSArIDFdOwoJY2luID4+IG47Cglmb3IgKGludCBpID0gMTsgaSA8PSBuOyArK2kpIHsKCQljaW4gPj4gZkxpbmVbaV07Cgl9CglpbnQgZ29vZExpbmUgPSAwOwoJZm9yIChpbnQgaSA9IDE7IGkgPD0gbjsgKytpKSB7CgkJY2luID4+IHNMaW5lW2ldOwoJCWlmIChmTGluZVtpXSAhPSBzTGluZVtpXSkgewoJCQkrK2dvb2RMaW5lOwoJCX0KCX0KCWlmIChnb29kTGluZSA9PSBuKSB7CgkJY291dCA8PCAiREEiOwoJfSBlbHNlIHsKCQljb3V0IDw8ICJOVSI7Cgl9CglyZXR1cm4gMDsKfQ==