#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
struct pt {
  long long x, y;
  pt(long long _x = 0, long long _y = 0) {
    x = _x;
    y = _y;
  }
  pt operator+(const pt &p) const { return pt(x + p.x, y + p.y); }
  pt operator-(const pt &p) const { return pt(x - p.x, y - p.y); }
  pt operator*(const long long p) const { return pt(p * x, p * y); }
};
long long det(pt a, pt b) { return a.x * b.y - a.y * b.x; }
long long dot(pt a, pt b) { return a.x * b.x + a.y * b.y; }
const int N = 2222;
pt p[N];
int order[N];
bool used[N];
char seq[N];
void solve() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    p[i] = pt(x, y);
  }
  scanf("%s", seq);
  int leftBot = 0;
  for (int i = 0; i < n; i++) {
    if (p[i].y < p[leftBot].y ||
        (p[i].y == p[leftBot].y && p[i].x < p[leftBot].x)) {
      leftBot = i;
    }
  }
  memset(used, 0, sizeof(used));
  order[0] = leftBot;
  used[leftBot] = true;
  for (int i = 1; i < n; ++i) {
    int chosen = -1;
    pt base = p[order[i - 1]];
    for (int j = 0; j < n; j++) {
      if (!used[j]) {
        if (chosen == -1 ||
            det(p[chosen] - base, p[j] - base) * (seq[i - 1] == 'R' ? 1 : -1) >
                0) {
          chosen = j;
        }
      }
    }
    used[chosen] = true;
    order[i] = chosen;
  }
  for (int i = 0; i < n; i++) {
    if (i) printf(" ");
    printf("%d", order[i] + 1);
  }
  printf("\n");
}
int main() {
  solve();
  return 0;
}
