O-anagram
You are given two arrays of small English letters A and B. if Any word made of letters from array A you can made of letters from array B we will say A is anagramic to B. if Any word made of letters from array B you can made of letters from array A we will say B is anagramic to A. If You use some letter from array A you can use it as many time as you wish. Same rule apply to B
InputIn first line of input is array A.
In first line of input is array B.
Every array can have max 100000 small English letters.
In first line of input is array B.
Every array can have max 100000 small English letters.
OutputOnly one line will be on output. If either of arrays is anagramic, write "DA n" where n is number of different letters in anagramic array. If neither of arrays is anagramic, write "NE x" where x is number of different letters appear in either arrays.
Input:
Output:
a
abcdefgh
Output:
DA 1
Input:
Output:
acababacbacaacacamacacamca
bucmast
Output:
DA 4
Input:
Output:
papak
papan
Output:
NE 4
Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.