#include <bits/stdc++.h>
struct point {
  int x, y, p;
};
point p[2005];
double asAngle(double angle) {
  angle = fmod(angle, M_PI * 2);
  if (angle > M_PI) angle -= M_PI * 2;
  if (angle < -M_PI) angle += M_PI * 2;
  return angle;
}
int main() {
  int n;
  char dirs[2005];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &p[i].x, &p[i].y);
    p[i].p = i + 1;
  }
  scanf("%s", dirs);
  int i1 = 0;
  for (int i = 1; i < n; i++) {
    if (p[i].x < p[i1].x) {
      i1 = i;
    }
  }
  std::swap(p[i1], p[--n]);
  printf("%d ", p[n].p);
  double prevAngle = 0;
  for (int iter = 0; n > 1; iter++) {
    double bestAngle =
        asAngle(atan2(p[0].y - p[n].y, p[0].x - p[n].x) - prevAngle);
    int bestI = 0;
    for (int i = 1; i < n; i++) {
      double angle =
          asAngle(atan2(p[i].y - p[n].y, p[i].x - p[n].x) - prevAngle);
      if ((dirs[iter] == 'L' && angle < bestAngle) ||
          (dirs[iter] == 'R' && angle > bestAngle)) {
        bestAngle = angle;
        bestI = i;
      }
    }
    std::swap(p[bestI], p[--n]);
    printf("%d ", p[n].p);
    prevAngle = atan2(p[n].y - p[n + 1].y, p[n].x - p[n + 1].x);
  }
  printf("%d\n", p[0].p);
  return 0;
}
