#!/usr/bin/env python
import sys
from subprocess import Popen, PIPE
from StringIO import StringIO
import fileinput

inp = fileinput.input()
exe = next(inp).strip()
args = "".join([line for line in inp])

try:
    proc = Popen(exe, stdin=PIPE, stdout=sys.stdout,
            stderr=sys.stderr, shell=True)
    proc.communicate(input=args)
except Exception as e:
    pass
finally:
    exit(proc.returncode)