import sys def modify_url line list line split old_url list new_url if

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
import sys
def modify_url(line):
list = line.split(' ')
old_url = list[0]
new_url = '\n'
if old_url.endswith('.avi'):
new_url = 'http://opennet.ru/'
return new_url
while True:
line = sys.stdin.readline().strip()
new_url = modify_url(line)
sys.stdout.write(new_url)
sys.stdout.flush()