fork(1) download
  1. def foo(napis):
  2. if len(napis) != 7:
  3. return False
  4. frak = "FRAKTAL"
  5. r = ord(frak[0]) - ord(napis[0])
  6. for i in range(1, 7):
  7. if ord(frak[i]) - ord(napis[i]) != r:
  8. return False
  9. return True
  10.  
  11.  
  12. if __name__ == '__main__':
  13. t = int(input())
  14. for i in range(t):
  15. napis = input()
  16. if foo(napis):
  17. print("tak")
  18. else:
  19. print("nie")
  20.  
Success #stdin #stdout 0.03s 9224KB
stdin
2
FRAKTAL
GSBLUBM
stdout
tak
tak