import sys

command = {
    '.': 'putchar(*ptr);',
    ',': '*ptr=getchar();',
    '[': 'while (*ptr) {',
    ']': '}'
}

repeatable = {
    '>': 'ptr += {};',
    '<': 'ptr -= {};',
    '+': '*ptr += {};',
    '-': '*ptr -= {};'
}

print('#include <stdio.h>')
print('\nchar array[30000];')
print('\nint main() {')
print('\tchar *ptr=array;')

op, cnt = None, 0
indent = 1
for c in sys.stdin.read():
    if c in repeatable.keys():
        if op is not None and op != c:
            print('\t'*indent, repeatable[op].format(cnt), sep='')
            op, cnt = c, 1
        else:
            op, cnt = c, cnt+1
    elif c in command.keys():
        if op is not None:
            print('\t'*indent, repeatable[op].format(cnt), sep='')
            op, cnt = None, 0
        if c == ']':
            indent -= 1
        print('\t'*indent, command[c], sep='')
        if c == '[':
            indent += 1
if op is not None:
    print('\t'*indent, repeatable[op].format(cnt), sep='')

print('}')