#!/usr/bin/env python3

'''
read in lines from stdin and apply the commands given from the command line
to them

example
  pydo 'line[::-1]' < file.txt
  ip addr | pydo '[ord(_) for _ in line]'
'''

# pylint: disable=exec-used

import sys

command = sys.argv[1]
cmd = print
exec('cmd = lambda line : ' + command)

data = (_.strip() for _ in sys.stdin.readlines())

for line in data:
    print(cmd(line))
