#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;
}