#include <bits/stdc++.h>
using namespace std;
const int N = 2010;
struct P {
  long long x, y;
  int id;
  bool operator<(P B) const {
    if (y != B.y) return y < B.y;
    return x < B.x;
  }
} p[N], op;
long long cross(P A, P B, P C) {
  return (A.x - B.x) * (C.y - B.y) - (C.x - B.x) * (A.y - B.y);
}
bool cmp(P A, P B) { return cross(A, op, B) < 0; }
char a[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld%lld", &p[i].x, &p[i].y);
    p[i].id = i;
  }
  scanf("%s", a + 1);
  sort(p + 1, p + n + 1);
  op = p[1];
  for (int i = 2; i < n; i++) {
    sort(p + i, p + n + 1, cmp);
    if (a[i - 1] == 'L') swap(p[i], p[n]);
    op = p[i];
  }
  for (int i = 1; i <= n; i++) {
    printf("%d ", p[i].id);
  }
  return 0;
}
