# Sesos: https://github[dot]com/DennisMitchell/sesos

import sys

S = {'>': 'fwd %d',
'<': 'rwd %d',
'+': 'add %d',
'-': 'sub %d',
',': 'get',
'.': 'put',
'[': 'jmp',
']': 'jnz'}


I = sys.stdin.read()

# remove invalid operations
t = I.replace('><','').replace('<>','').replace('+-','').replace('-+','')
while t != I:
	I = t
	t = I.replace('><','').replace('<>','').replace('+-','').replace('-+','')

I = list(I)

r = ""
n = 0
while I:
	c = I.pop(0)
	if c in "><+-":
		if r == c:
			n += 1
		else:
			if r:print S[r] % n
			r = c
			n = 1
	elif c in ",.[]":
		if r:
			print S[r] % n
			r = ""
			n = 0
		print S[c]
		if I and ((c == "[" and I[0] == "]") or (c == "]" and I[0] == "[")):
			print "nop"
	else:
		# Ignore comments
		pass
	
	if not I and r:
		print S[r] % n
