#include <bits/stdc++.h>
const int N = 5005;
using namespace std;
struct poi {
  int x, y, id;
  double dis;
} a[N], st[N];
char s[N];
long long sqr(int x) { return (long long)x * x; }
long long cross(poi p0, poi p1, poi p2) {
  return (long long)(p1.x - p0.x) * (p2.y - p0.y) -
         (long long)(p2.x - p0.x) * (p1.y - p0.y);
}
bool cmp(poi b, poi c) {
  long long tmp = cross(a[1], b, c);
  if (!tmp) return b.dis < c.dis;
  return tmp > 0;
}
int Graham(int n) {
  int k = 1;
  for (int i = 1; i <= n; ++i)
    if (a[i].x < a[k].x || (a[i].x == a[k].x && a[i].y < a[k].y)) k = i;
  swap(a[1], a[k]);
  for (int i = 2; i <= n; ++i)
    a[i].dis = sqr(a[i].x - a[1].x) + sqr(a[i].y - a[1].y);
  sort(a + 2, a + n + 1, cmp);
  st[1] = a[1], st[2] = a[2];
  int top = 2;
  for (int i = 3; i <= n; ++i) {
    for (; top > 1 && cross(st[top - 1], a[i], st[top]) >= 0LL;) --top;
    st[++top] = a[i];
  }
  st[0] = st[top];
  st[top + 1] = st[1];
  return top;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &a[i].x, &a[i].y);
    a[i].id = i;
  }
  scanf("%s", s + 1);
  int top = Graham(n);
  poi o = a[1];
  printf("%d", o.id);
  int m = n;
  for (int i = 1; i <= n - 2; ++i) {
    int top = Graham(m), tmp = o.id;
    for (int j = 1; j <= top; ++j)
      if (st[j].id == o.id) {
        if (s[i] == 'L') {
          printf(" %d", st[j + 1].id);
          o = st[j + 1];
        } else {
          printf(" %d", st[j - 1].id);
          o = st[j - 1];
        }
        break;
      }
    for (int j = 1; j <= m; ++j)
      if (a[j].id == tmp) {
        for (int k = j; k <= m - 1; ++k) a[k] = a[k + 1];
        break;
      }
    --m;
  }
  for (int i = 1; i <= m; ++i)
    if (a[i].id != o.id) {
      printf(" %d\n", a[i].id);
      break;
    }
  return 0;
}
