#include <bits/stdc++.h>
using namespace std;
const int maxn = 2021;
int n;
char str[maxn];
struct point {
  int x, y, id;
} A[maxn];
point operator-(point A, point B) { return {A.x - B.x, A.y - B.y}; }
long long operator*(point A, point B) {
  return 1ll * A.x * B.y - 1ll * B.x * A.y;
}
point O;
int ans[maxn];
signed main() {
  cin >> n;
  for (int i = (1), iend = (n); i <= iend; ++i)
    scanf("%d%d", &A[i].x, &A[i].y), A[i].id = i;
  scanf("%s", str + 1);
  for (int i = (1), iend = (n); i <= iend; ++i)
    if (A[i].y < A[1].y || (A[i].y == A[1].y && A[i].x < A[1].x)) {
      swap(A[1], A[i]);
    }
  int cur = 1, len = n;
  ans[1] = A[1].id;
  while (cur < n - 1) {
    O = A[1];
    sort(A + 2, A + len + 1,
         [](point P, point Q) { return (O - P) * (O - Q) > 0; });
    if (str[cur] == 'L') {
      ans[++cur] = A[2].id, A[1] = A[2];
      for (int i = (2), iend = (--len); i <= iend; ++i) A[i] = A[i + 1];
    } else {
      ans[++cur] = A[len].id, A[1] = A[len--];
    }
  }
  ans[n] = A[2].id;
  for (int i = (1), iend = (n); i <= iend; ++i) printf("%d ", ans[i]);
  return 0;
}
