#include <bits/stdc++.h>
using namespace std;
//mudar file.in pelo nome do input e por FILE_IN
//antes dos scanfs
#define FILE_IN freopen("file.in", "r", stdin);
#define fr(i,n) for(int i=0;i<n;i++)
#define frr(i,a,b) for(int i =a;i<=b;i++)
// for(auto it : g[i].nb)
typedef long long ll;
typedef long double ld;
#define pb push_back
#define all(a) a.begin(),a.end()
#define fi first
#define se second
typedef pair<int,int> pii;
#define PI acos(-1)
ll MOD = 1e9+7;
//LONG_LONG_MAX
//-DBL_MAX
bool debug = 0;
#define printa(a) cout << #a << " = " << (a) << endl
#define prin(a) if(debug) cout << #a << " = " << (a) << endl
#define prinsep if(debug) cout << "------" << endl;
#define cendl if(debug) cout << endl
class oin{
public:
bool mais;
int k;
vector<int> v;
};
vector<oin> v;
string ss(int i){
if(i==0){
return string("project");
} else{
string s = "object";
s+= to_string(i);
return s;
}
}
void dfs(int ii, int niv){
string sout;
fr(i,niv){
sout+=" ";
}
if(v[ii].k){
if(v[ii].mais){
sout[sout.size()-2] = '+';
} else{
sout[sout.size()-2] = '-';
}
}
sout+=ss(ii);
printf("%s\n", sout.c_str());
if(!v[ii].mais){
for(auto it : v[ii].v){
dfs(it,niv+1);
}
}
return;
}
int main(){
int n;
scanf("%d", &n);
v.resize(n+1);
fr(i,n+1){
char c;
int k;
scanf(" %c %d", &c, &k);
if(c=='+') v[i].mais = 1;
else v[i].mais = 0;
if(c=='+' and k==0){
while(1) continue;
}
v[i].k = k;
v[i].v.resize(k);
fr(j,k){
scanf("%d", &v[i].v[j]);
}
}
/*
string s = "oi";
s+=to_string(100);
s+= " oi";
cout << s << endl;
return 0;
*/
dfs(0,1);
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgovL211ZGFyIGZpbGUuaW4gcGVsbyBub21lIGRvIGlucHV0IGUgcG9yIEZJTEVfSU4KLy9hbnRlcyBkb3Mgc2NhbmZzCiNkZWZpbmUgRklMRV9JTiBmcm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