```cpp #include #include #include using namespace std; typedef long long LL;
char s[108]; vector num[108];
void dfs(int u, int k) { int d = num[u].size(); for (int i = 0; i int v = num[u][i]; for (int j = 0; j if (num[v].size()) { if (s[v] == '-') { printf("- object%d\n", v); dfs(v, k + 1); } else { printf("+ object%d\n", v); } } else { printf(" object%d\n", v); } } }
int main() { #ifdef LOCAL freopen("a.txt", "r", stdin); // freopen("b.txt", "w", stdout); int T = 1; while (T--) { #endif int n, k, val; scanf("%d", &n); for (int i = 0; i <= n; ++i) { getchar(); scanf("%c", &s[i]); scanf("%d", &k); while (k--) { scanf("%d", &val); num[i].push_back(val); } } if (n == 0) { printf(" project\n"); } else { if (s[0] == '-') { printf("- project\n"); dfs(0, 1); } else { printf("+ project\n"); } } #ifdef LOCAL printf("\n"); } #endif return 0; } ```