#include <bits/stdc++.h> using namespace std; struct node { int l, r; int idx; double prob; }; const int maxn = 100000; string ANSS[maxn]; node g[maxn]; vector <string> ans; bool cmp(string &a, string &b) { int cnta = 0; for(auto ch : a) { cnta += (ch=='.' ? 1 : 2); } int cntb = 0; for(auto ch : b) { cntb += (ch == '.' ? 1 : 2); } return cnta < cntb; } void dfs(int v, string s) { if(g[v].l != 0) { dfs(g[v].l, s+'-'); dfs(g[v].r,s+'.'); } else ans.push_back(s); } bool cmp2(node x, node y) { return x.prob < y.prob; } int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; int i, j; cin >> n; priority_queue <pair <double, int> > pq; for(i = 1; i <= n; i++) { cin >> g[i].prob; g[i].idx = i; pq.push({-g[i].prob, i}); } sort(g+1,g+n+1,cmp2); int curr = n+1; while(pq.size()>1) { auto f = pq.top(); pq.pop(); auto s = pq.top(); pq.pop(); g[curr].l = f.second; g[curr].r = s.second; pq.push({f.first+s.first, curr}); curr++; } int root = pq.top().second; dfs(root,""); sort(ans.begin(),ans.end(),cmp); for(i = 1; i <= n; i++) { ANSS[g[i].idx] = ans[i-1]; } for(i = 1; i <= n; i++) cout << ANSS[i] << endl; return 0; }