#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;
}