# Arup Guha
# 3/18/2025
# Solution to 2025 UCF HSPT Problem" Garden Flowers

'''
The key observation here is that all we need for two different paths is
a small subpath that diverges. In particular, if we ever have a 2 by 2
square that looks like:

XO
OY

where X, O and Y each represent some letter, then there are two paths.
There has to be some way to get to X and then there are two ways to get
to Y. If this never happens, all items are unique. The reason behind this
is we require two paths to be unique. To be unique, take the last common
spot of the path, then there are only two ways to go. If those two letters
are different, the words they form will be different. So, if we there does
exist two separate paths that spell the same string, then you will have
those two letters in question be the same.
'''

# Get # of rows.
n = int(input())

# Read in grid.
words = []
for i in range(n):
    words.append(input().strip())

# We'll turn this to true if it's possible.
flag = False

# Go to all squares that could be the top left corner of a 2 by 2 square.
for i in range(n-1):
    for j in range (1,n):
        if words[i][j] == words[i+1][j-1]:
            flag = True

# Print result.
if flag:
    print("duplicates")
else:
    print("unique")
