#include <bits/stdc++.h>
using namespace std;
long long read() {
  int f = 1;
  long long res = 0;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -f;
  } while (ch < '0' || ch > '9');
  do {
    res = res * 10 + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return f == 1 ? res : -res;
}
void fast_io() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const int N = 2010;
const int mod = 998244353;
const long long INF = 1e18;
int n, m, q;
int A[N], B[N], C[N];
char str[N];
bool used[N];
int head[N * 2], to[N * N], nxt[N * N], tot;
void addEdge(int u, int v) {
  tot++;
  nxt[tot] = head[u];
  to[tot] = v;
  head[u] = tot;
}
template <class T>
T mmax(T a, T b) {
  return a > b ? a : b;
}
long long mmin(long long a, long long b) { return a < b ? a : b; }
int countOne(int set) {
  int res = 0;
  while (set) {
    res++;
    set &= set - 1;
  }
  return res;
}
bool contain(int set, int i) { return (set & (1 << i)) > 0; }
long long myPow(long long a, int p) {
  if (p == 0) return 1;
  long long res = myPow(a, p / 2);
  res *= res;
  res %= mod;
  if (p % 2 == 1) {
    res *= a;
    res %= mod;
  }
  return res;
}
void addMode(int &a, long long b) { a = (a + b) % mod; }
long long mul(long long a, long long b) { return a * b % mod; }
template <class T>
void mySwap(T &a, T &b) {
  T tmp = a;
  a = b;
  b = tmp;
}
long long cross(int i, int j, int k) {
  long long x1 = A[j] - A[i];
  long long y1 = B[j] - B[i];
  long long x2 = A[k] - A[i];
  long long y2 = B[k] - B[i];
  return x1 * y2 - x2 * y1;
}
int main() {
  fast_io();
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> A[i];
    cin >> B[i];
  }
  cin >> str;
  int d = 1;
  for (int i = 2; i <= n; i++) {
    if (A[i] < A[d] || (A[i] == A[d] && B[i] < B[d])) d = i;
  }
  used[d] = true;
  C[0] = d;
  for (int i = 0; i < n - 1; i++) {
    int nd = 0;
    for (int j = 1; j <= n; j++)
      if (!used[j]) {
        if (!nd) {
          nd = j;
        } else {
          long long now = cross(d, j, nd);
          if (str[i] == 'R') now = -now;
          if (now > 0) nd = j;
        }
      }
    C[i + 1] = nd;
    d = nd;
    used[d] = true;
  }
  for (int i = 0; i < n; i++) cout << C[i] << " ";
  cout << endl;
  return 0;
}
