const input = require('fs').readFileSync('./input.txt').toString().trim().split('\n')
const [n, ...num] = input;
const numbers = num.map(v => +v);
const stack = [];
let answer = '';
let count = 1;
for(let i=0; i<n; i++) {
const number = numbers.shift();
while(count <= number) {
stack.push(count++);
answer += '+ ';
}
if(stack.pop() !== number) {
answer = 'NO'
break;
}
answer += '- '
}
console.log(answer.split(' ').join('\n'))
기본으로 1이 시작이기 때문에 number가 count 이하일 땐 push를 해주고, stack.pop을 하는 값이 number가 없다면 NO만 출력, 그리고 count 이하가 아닌 모든 값은 -이기 때문에 그에 맞게 출력!