#!/usr/bin/python
# coding=utf-8
flag = "AGH_{FLAGA}"
text = "To jest przykładowy tekst!"


flag_int = [ord(letter) for letter in flag]
text_int = [ord(letter) for letter in text]

for i in range(len(text_int) % len(flag_int)):
  text_int.append(0)

flag_int = len(text_int)/len(flag_int)*flag_int

result = [chr(i^j) for i,j in zip(flag_int, text_int)]

print "".join(result)
