#include <iostream>
#include <string>
#include <stack>
#include <vector>
#include <algorithm>
using namespace std;
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
stack<int> stacks;
vector<char> vectors;
int pushNum = 1;
int input = 0;
cin >> input;
for (int i = 0; i < input; ++i)
{
int num = 0;
cin >> num;
while (1)
{
if (!stacks.empty())
{
if (stacks.top() < num)
{
stacks.push(pushNum++);
vectors.push_back('+');
}
else if (stacks.top() == num)
{
stacks.pop();
vectors.push_back('-');
break;
}
else if (stacks.top() > num)
{
cout << "NO";
return 0;
}
}
else
{
stacks.push(pushNum++);
vectors.push_back('+');
}
}
}
for (const auto iter : vectors)
{
cout << iter << "\n";
}
/* for (auto iter = vectors.begin(); iter != vectors.end(); ++iter)
{
}*/
return 0;
}
코딩 테스트