#!/usr/bin/python
# -*- coding: utf-8 -*-
import select
import sys
import tty
poller = select.poll()
poller.register( sys.stdin, select.POLLIN )
tty.setcbreak( sys.stdin )
while True:
events = poller.poll( 500 )
if events:
char = sys.stdin.read(1)
while char:
print ord(char)
char = sys.stdin.read(1)