#include <bits/stdc++.h>
using namespace std;
int n;
long long x[2001], y[2001];
char s[2001], u[2001];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld%lld", &x[i], &y[i]);
  scanf("%s", s + 2);
  s[n] = 'L';
  int cur = 0;
  for (int i = 1; i <= n; i++)
    if (!cur || x[cur] > x[i]) cur = i;
  cout << cur << " ";
  u[cur] = 1;
  for (int j = 2; j <= n; j++) {
    int nx = 0;
    double dd;
    for (int i = 1; i <= n; i++) {
      if (!u[i]) {
        if (nx == 0) {
          nx = i;
        } else {
          long long o = (x[i] - x[cur]) * (y[nx] - y[cur]) -
                        (x[nx] - x[cur]) * (y[i] - y[cur]);
          if (s[j] == 'L' && o >= 0) {
            nx = i;
          }
          if (s[j] == 'R' && o <= 0) {
            nx = i;
          }
        }
      }
    }
    u[nx] = 1;
    cur = nx;
    cout << cur << " ";
  }
}
