class Stack:
    def __init__(self):
        self.len = 0
        self.list = []
        
    def push(self, x):
        self.list.append(x)
        self.len += 1
        
    def pop(self):
        if(self.size() == 0):
            return -1
        self.len -= 1
        return self.list.pop()
    
    def size(self):
        return self.len
        
    def top(self):
        return self.list[-1] if self.size() else -1
    
    def empty(self):
        return 1 if len(self.list) == 0 else 0
        
Case = int(input())
num_list = [int(input()) for _ in range(Case)]
output_list = []

num_pointer = 0
stack = Stack()

for i in range(Case):
    stack.push(i + 1)
    output_list.append('+')
    
    while(num_pointer < Case and stack.top() == num_list[num_pointer]):
        stack.pop()
        output_list.append('-')
        num_pointer += 1
        
if not stack.empty():
    print("NO")
else:
    for i in output_list:
        print(i)

'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글

백준 2504번(python)  (0) 2019.06.03
백준 9012번(python)  (0) 2019.06.02
백준 10828번(python)  (0) 2019.06.02
백준 9020번(python)  (0) 2019.05.31
백준 4948번(python)  (0) 2019.05.31