from __future__ import print_function
from collections import deque
try:
    input = raw_input
    range = xrange
except NameError:
    pass
 
"""
aaaa ..... n NOP - no operation; do nothing
aaab ..... i Input - push input onto top of stack
aaba ..... > Rot - pops top stack element and pushes to bottom of stack
aabb ..... \ Swap - swaps top two stack elements
aabc ..... 1 Push - pushes a 1 onto the top of stack (creates new element)
abaa ..... < RRot - pops bottom element and pushes to top of stack
abab ..... d Dup - Duplicates top stack element
abac ..... + Add - pops top two elements and pushes their sum
abba ..... [ L-brace - skip to matching ] if top stack element is 0
abbb ..... o Output - pops and outputs top stack element
abbc ..... * Multiply - pops top two elements and pushes their product
abca ..... e Execute - Pops four elements and interprets them as an instruction
abcb ..... - Negate - pops value from stack, pushes -(value)
abcc ..... ! Pop - pops and discards top stack element
abcd ..... ] R-brace - skip back to matching [
"""
 
def chunks(l, n):
	return (l[i:i+n] for i in range(0, len(l), n))
 
def convert(inst):
	i = 0
	for c in inst:
		i = i*4 + inst.index(c)
 
	return "n..i....>.\\1....<d.+[o.*e-!]"[i]
 
def _compile(code):
	return map(convert, chunks(code, 4))
 
def main():
	stack = deque()
	code = input()
	code = _compile(code)
	#print("".join(code))
 
	# program counter / instruction pointer
	pc = 0
 
	while pc < len(code):
 
		inst = code[pc]
 
		if inst == 'n':
			pass
 
		elif inst == 'i':
			stack.append(ord(input()))
 
		elif inst == '>':
			stack.rotate(1)
 
		elif inst == '\\':
			a = stack.pop()
			b = stack.pop()
			stack.append(a)
			stack.append(b)
 
		elif inst == '1':
			stack.append(1)
 
		elif inst == '<':
			stack.rotate(-1)
 
		elif inst == 'd':
			a = stack.pop()
			stack.append(a)
			stack.append(a)
 
		elif inst == '+':
			a = stack.pop()
			b = stack.pop()
			stack.append(a + b)
 
		elif inst == '*':
			a = stack.pop()
			b = stack.pop()
			stack.append(a * b)
 
		elif inst == 'o':
			a = stack.pop()
			print(chr(a))
 
		elif inst == '-':
			a = stack.pop()
			stack.append(-a)
 
		elif inst == '!':
			a = stack.pop()
 
		elif inst == 'e':
			a = stack.pop()
			b = stack.pop()
			c = stack.pop()
			d = stack.pop()
			inst = convert([chr(a),chr(b),chr(c),chr(d)])
			continue
 
		elif inst == '[':
			a = stack.pop()
			if a == 0:
				# advance to end of loop
				loop_level = 1
				while loop_level > 0:
					pc += 1
					if pc > len(code):
						raise Exception("Bracket mismatch")
					if   code[pc] == '[': loop_level += 1
					elif code[pc] == ']': loop_level -= 1
 
		elif inst == ']':
			# rewind to the start of the loop
			loop_level = 1
			while loop_level > 0:
				pc -= 1
				if pc < 0:
					raise Exception("Bracket mismatch")
				if   code[pc] == '[': loop_level -= 1
				elif code[pc] == ']': loop_level += 1
			pc -= 1
 
		else:
			 raise Exception("Unknown instruction '%s' at index %s.".format(inst, pc))
 
		pc += 1
 
main()