#include <bits/stdc++.h>
using namespace std;
int n;
struct point {
  int x, y;
  int id;
} h[2005];
bool cmp(point a, point b) {
  if (a.x == b.x) return a.y < b.y;
  return a.x < b.x;
}
bool used[2005];
char s[2005];
long long Cross(point a, point b) { return 1LL * a.x * b.y - 1LL * a.y * b.x; }
point operator-(point a, point b) { return (point){a.x - b.x, a.y - b.y}; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &h[i].x, &h[i].y);
    h[i].id = i;
  }
  scanf("%s", s + 1);
  sort(h + 1, h + n + 1, cmp);
  printf("%d ", h[1].id);
  int lst = 1;
  for (int i = 2; i < n; i++) {
    int id = -1;
    for (int j = 2; j <= n; j++) {
      if (used[j]) continue;
      if (id == -1)
        id = j;
      else if (Cross(h[j] - h[lst], h[id] - h[lst]) *
                   (2 * (s[i - 1] == 'L') - 1) >
               0)
        id = j;
    }
    printf("%d ", h[id].id);
    used[id] = 1;
    lst = id;
  }
  for (int i = 2; i <= n; i++) {
    if (!used[i]) printf("%d ", h[i].id);
  }
  return 0;
}
