# include<iostream>
using namespace std;
int main()
{
int n,i,j,ok,c=0;
cin>>n;
int v[n];
int a[n][n];
for(i=0;i<n;i++)
cin>>v[i];
for(i=0;i<n;i++)
{
ok=1;
for(j=0;j<n;j++)
{
cin>>a[i][j];
if(v[j]!=a[i][j])
ok=0;
}
if(ok==0)
c=1;
}
if(c)
cout<<"Da";
else
cout<<"Nu";
return 0;
}