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