#include <bits/stdc++.h>
struct point {
  long long x, y;
} p[2001];
char s[2001];
int N, order[2001], del[2001], convex[2001], C, O[2001];
inline long long check_convex(int a, int b, int c) {
  return (p[b].y - p[a].y) * (p[c].x - p[b].x) -
         (p[c].y - p[b].y) * (p[b].x - p[a].x);
}
void find_convex() {
  static int qu[2003], qd[2001];
  int U = 0, D = 0;
  for (int i = 1; i <= N; i++)
    if (!del[order[i]]) {
      if (U && p[order[i]].x == p[qu[U]].x)
        if (p[order[i]].y <= p[qu[U]].y)
          continue;
        else
          U--;
      while (U > 1 && check_convex(qu[U - 1], qu[U], order[i]) <= 0) U--;
      qu[++U] = order[i];
    }
  for (int i = 1; i <= N; i++)
    if (!del[order[i]]) {
      if (D && p[order[i]].x == p[qd[D]].x)
        if (p[order[i]].y >= p[qd[D]].y)
          continue;
        else
          D--;
      while (D > 1 && check_convex(qd[D - 1], qd[D], order[i]) >= 0) D--;
      qd[++D] = order[i];
    }
  C = U;
  std::copy(qu + 1, qu + U + 1, convex + 1);
  if (qu[U] != qd[D]) convex[++C] = qd[D];
  for (int i = D - 1; i > 1; i--) convex[++C] = qd[i];
  if (qu[1] != qd[1]) convex[++C] = qd[1];
}
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) scanf("%lld%lld", &p[i].x, &p[i].y);
  scanf("%s", s + 1);
  for (int i = 1; i <= N; i++) order[i] = i;
  std::sort(order + 1, order + N + 1,
            [](int x, int y) { return p[x].x < p[y].x; });
  find_convex();
  O[1] = convex[1];
  O[2] = convex[s[1] == 'L' ? C : 2];
  del[O[1]] = 1;
  for (int i = 3; i < N; i++) {
    find_convex();
    int p = std::find(convex + 1, convex + C + 1, O[i - 1]) - convex;
    if (s[i - 1] == 'L')
      O[i] = convex[p == 1 ? C : p - 1];
    else
      O[i] = convex[p == C ? 1 : p + 1];
    del[O[i - 1]] = 1;
  }
  del[O[N - 1]] = 1;
  O[N] = std::find(del + 1, del + N + 1, 0) - del;
  for (int i = 1; i <= N; i++) printf("%d%c", O[i], " \n"[i == N]);
  return 0;
}
