from random import *
import urllib.request, re
my_url = input("\ ")
name = "".join(sample([chr(i) for i in range(97, 123)],6))+str(randint(11111,99999))+str(randint(11111,99999))
ext = re.findall(r'.+(\.{1}[a-zA-Z]+)[^\.]*', my_url)[0]
pic = urllib.request.urlopen(my_url).read()
f = open(name+ext, "wb")
f.write(pic)
f.close()
print('OK')
ZnJvbSByYW5kb20gaW1wb3J0ICoKaW1wb3J0IHVybGxpYi5yZXF1ZXN0LCByZQpteV91cmwgPSBpbnB1dCgiXCAiKQpuYW1lID0gIiIuam9pbihzYW1wbGUoW2NocihpKSBmb3IgaSBpbiByYW5nZSg5NywgMTIzKV0sNikpK3N0cihyYW5kaW50KDExMTExLDk5OTk5KSkrc3RyKHJhbmRpbnQoMTExMTEsOTk5OTkpKQpleHQgPSByZS5maW5kYWxsKHInLisoXC57MX1bYS16QS1aXSspW15cLl0qJywgbXlfdXJsKVswXQpwaWMgPSB1cmxsaWIucmVxdWVzdC51cmxvcGVuKG15X3VybCkucmVhZCgpCmYgPSBvcGVuKG5hbWUrZXh0LCAid2IiKQpmLndyaXRlKHBpYykKZi5jbG9zZSgpCnByaW50KCdPSycp