structEdge { int to, next, k; bool ext; } e[maxn * 2]; int c1, head[maxn], du[maxn]; inlinevoidadd_edge(int u, int v, int k){ e[c1].to = v; e[c1].k = k; e[c1].next = head[u]; head[u] = c1++; }
int ans[maxn]; voiddfs(int u){ for (int &i = head[u]; ~i; i = e[i].next) { int v = e[i].to, k = e[i].k; bool &ext = e[i].ext, &Ext = e[i ^ 1].ext; if (ext) continue; ext = Ext = 1; dfs(v); if (u <= N || v > N) ans[k] = 1; elseif (u > N || v <= N) ans[k] = 0; } }
intmain(){ fill(head, head + maxn, -1); ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
cin >> n; for (int i = 1; i <= n; ++i) { int x, y; cin >> x >> y; add_edge(x, y + N, i); add_edge(y + N, x, i); ++du[x]; ++du[y + N]; } int rt = 2 * N + 1; for (int i = 1; i <= 2 * N; ++i) if (du[i] & 1) add_edge(i, rt, 0), add_edge(rt, i, 0); for (int i = 1; i <= 2 * N; ++i) dfs(i); for (int i = 1; i <= n; ++i) cout << (ans[i] ? 'b' : 'r'); cout << "\n"; return0; }