# coding: utf-8
import serial
ser = serial.Serial(4, 9600, timeout=1)
print ser.portstr
c = "\0"
# MAIN LOOP
while True:
c = raw_input()
ser.write(c)
if(c == 'q'):
break;
ser.close()
IyBjb2Rpbmc6IHV0Zi04CmltcG9ydCBzZXJpYWwKCnNlciA9IHNlcmlhbC5TZXJpYWwoNCwgOTYwMCwgdGltZW91dD0xKQpwcmludCBzZXIucG9ydHN0cgpjID0gIlwwIgoKIyBNQUlOIExPT1AKd2hpbGUgVHJ1ZToKICAgIGMgPSByYXdfaW5wdXQoKQogICAgc2VyLndyaXRlKGMpCiAgICBpZihjID09ICdxJyk6CiAgICAgICAgYnJlYWs7CgpzZXIuY2xvc2UoKQ==