import fileinput for line in fileinput.input(): process(line)