Replacement
Vlatko likes to play with integer arrays. He wrote two arrays of elements on a piece of paper, each element being either a positive integer or a sequence of lowercase letters of the English alphabet representing a variable. A variable can be replaced with an arbitrary integer. It's possible that both arrays contain the same variable or the same variable occurs multiple times in an array. If that’s the case, each occurence of the variable has to be replaced with the same integer in both arrays.
Vlatko wonders if it's possible to replace all variables with some integer values in such a way that the two arrays become equal. Two arrays are considered equal if the numbers on the same positions in the arrays are equal.
Input
The first line contains a positive integer (), the number of elements in each array.The second line contains elements of the first array.The third line contains elements of the second array.
Each element in both arrays can either be:
a positive integer less than or
a sequence of lowercase letters of the English alphabet (no longer than characters) which represents a variable.
Output
If it's possible to replace all variables with integer values in a way that the two arrays become equal, print DA
(Croatian for yes, without the quotation marks). Otherwise print NE
(Croatian for no).
Examples
Note
By introducing substitutions , , , both arrays will become equal .