#include <iostream>
using namespace std;
int main() {
int size;
cin >> size;
int strictlyAscending = 1;
for (int line = 1; line <= size; ++line) {
for (int col = 1; col <= size; ++col) {
int currentEl;
cin >> currentEl;
if (line == col){
int previousEl;
if (line > 1 && currentEl <= previousEl) {
strictlyAscending = 0;
}
previousEl = currentEl;
}
}
}
if (strictlyAscending) {
cout << "DA";
} else {
cout << "NU";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICBpbnQgc2l6ZTsKICAgIGNpbiA+PiBzaXplOwogICAgaW50IHN0cmljdGx5QXNjZW5kaW5nID0gMTsKICAgIGZvciAoaW50IGxpbmUgPSAxOyBsaW5lIDw9IHNpemU7ICsrbGluZSkgewogICAgICAgIGZvciAoaW50IGNvbCA9IDE7IGNvbCA8PSBzaXplOyArK2NvbCkgewogICAgICAgICAgICBpbnQgY3VycmVudEVsOwogICAgICAgICAgICBjaW4gPj4gY3VycmVudEVsOwogICAgICAgICAgICBpZiAobGluZSA9PSBjb2wpewogICAgICAgICAgICAgICAgaW50IHByZXZpb3VzRWw7CiAgICAgICAgICAgICAgICBpZiAobGluZSA+IDEgJiYgY3VycmVudEVsIDw9IHByZXZpb3VzRWwpIHsKICAgICAgICAgICAgICAgICAgICBzdHJpY3RseUFzY2VuZGluZyA9IDA7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBwcmV2aW91c0VsID0gY3VycmVudEVsOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgaWYgKHN0cmljdGx5QXNjZW5kaW5nKSB7CiAgICAgICAgY291dCA8PCAiREEiOwogICAgfSBlbHNlIHsKICAgICAgICBjb3V0IDw8ICJOVSI7CiAgICB9CiAgICByZXR1cm4gMDsKfQ==