from functools import lru_cache import sys input = sys.stdin.readline sys.setrecursionlimit(10 ** 7) N = int(input()) red_red = [[] for _ in range(N + 1)] red_blue = [[] for _ in range(N + 1)] blue_blue = [[] for _ in range(N + 1)] blue_red = [[] for _ in range(N + 1)] for i in range(1, N+1): c, x, y = input().rstrip().split() y = int(y) if c == "R": if x == "R": red_red[y].append(i) else: red_blue[y].append(i) else: if x == "R": blue_red[y].append(i) else: blue_blue[y].append(i) ans = [] def rec(R, B, now): if R + B == N: ans.append(now) return True if red_red[R]: x = red_red[R].pop() if rec(R + 1, B, x): ans.append(now) return True red_red[R].append(x) if red_blue[B]: x = red_blue[B].pop() if rec(R + 1, B, x): ans.append(now) return True red_blue[B].append(x) if blue_red[R]: x = blue_red[R].pop() if rec(R, B + 1, x): ans.append(now) return True blue_red[R].append(x) if blue_blue[B]: x = blue_blue[B].pop() if rec(R, B + 1, x): ans.append(now) return True blue_blue[B].append(x) return False if not rec(0, 0, 0): print("No") else: print("Yes") ans.pop() print(*ans[::-1])