#include <bits/stdc++.h>
using namespace std;
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const double EPS = 1e-9;
const double PI = acos(-1.);
const int INF = 1e9;
const long long MOD = 1e9 + 7;
const int MAXN = 2e3 + 5;
complex<long long> pt[MAXN];
int used[MAXN];
char s[MAXN];
long long cross(complex<long long> &o, complex<long long> &a,
                complex<long long> &b) {
  return imag(conj(a - o) * (b - o));
}
void solve() {
  int n;
  scanf("%d", &n);
  for (int i = (0); i < (int)(n); i++) {
    long long x, y;
    scanf("%lld%lld", &x, &y);
    pt[i] = complex<long long>(x, y);
  }
  scanf("%s", &s[0]);
  int ind = 0;
  for (int i = (1); i < (int)(n); i++) {
    if (pt[i].real() < pt[ind].real() ||
        pt[i].real() == pt[ind].real() && pt[i].imag() < pt[ind].imag()) {
      ind = i;
    }
  }
  for (int i = (0); i < (int)(n); i++) {
    printf("%d ", ind + 1);
    used[ind] = 1;
    int mini = -1;
    for (int j = (0); j < (int)(n); j++) {
      if (used[j]) {
        continue;
      }
      if (mini == -1) {
        mini = j;
        continue;
      }
      long long v = cross(pt[ind], pt[mini], pt[j]);
      if (s[i] == 'L' && v < 0) {
        mini = j;
      } else if (s[i] == 'R' && v > 0) {
        mini = j;
      }
    }
    ind = mini;
  }
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
}
