#include <iostream>
using namespace std;
const int MAX_SIZE = 10;
int main() {
int size;
cin >> size;
int strictlyAscending = 1;
for (int line = 1; line <= size; ++line) {
for (int col = 1; col <= size; ++col) {
int mt[MAX_SIZE +1][MAX_SIZE + 1];
cin >> mt[line][col];
if (line > 1 && line == col && mt[line][col] <= mt[line - 1][col - 1]) {
strictlyAscending = 0;
}
}
}
if (strictlyAscending) {
cout << "DA";
} else {
cout << "NU";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY29uc3QgaW50IE1BWF9TSVpFID0gMTA7CgppbnQgbWFpbigpIHsKICAgIGludCBzaXplOwogICAgY2luID4+IHNpemU7CiAgICBpbnQgc3RyaWN0bHlBc2NlbmRpbmcgPSAxOwogICAgZm9yIChpbnQgbGluZSA9IDE7IGxpbmUgPD0gc2l6ZTsgKytsaW5lKSB7CiAgICAgICAgZm9yIChpbnQgY29sID0gMTsgY29sIDw9IHNpemU7ICsrY29sKSB7CiAgICAgICAgICAgIGludCBtdFtNQVhfU0laRSArMV1bTUFYX1NJWkUgKyAxXTsKICAgICAgICAgICAgY2luID4+IG10W2xpbmVdW2NvbF07CiAgICAgICAgICAgIGlmIChsaW5lID4gMSAmJiBsaW5lID09IGNvbCAmJiBtdFtsaW5lXVtjb2xdIDw9IG10W2xpbmUgLSAxXVtjb2wgLSAxXSkgewogICAgICAgICAgICAgICAgc3RyaWN0bHlBc2NlbmRpbmcgPSAwOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgaWYgKHN0cmljdGx5QXNjZW5kaW5nKSB7CiAgICAgICAgY291dCA8PCAiREEiOwogICAgfSBlbHNlIHsKICAgICAgICBjb3V0IDw8ICJOVSI7CiAgICB9CiAgICByZXR1cm4gMDsKfQ==