fork download
  1. #65 - 90
  2. t=int(input())
  3. B=[127,131,137,139,149]
  4. for i in range(t):
  5. n=int(input())
  6. A=list(map(int,input().split()))
  7. f=1
  8. ans=0
  9. tmp=0
  10. for z in B:
  11. f=1
  12. for x in range(n):
  13. if A[x]%z>=65 and A[x]%z<=90:
  14. if x==n-1:
  15. f=0
  16. ans=z
  17. tmp+=1
  18. continue
  19. else:
  20. break
  21.  
  22. if ans==0 or tmp>1:
  23. print("NIECZYTELNE")
  24. continue
  25. s=''
  26. for x in range(n):
  27. # print(A[x],ans)
  28.  
  29. integer=A[x]%ans
  30. s+=chr(integer)
  31. # print(s,z)
  32. print(z,s)
  33.  
  34.  
  35.  
Success #stdin #stdout 0.04s 9760KB
stdin
1
5
65 66 67 68 69
stdout
NIECZYTELNE