#include <bits/stdc++.h>
using namespace std;
const long long llINF = 9223372036854775807;
const int INF = 2147483647;
const int maxn = 2e3 + 7;
const int maxm = 8e5 + 7;
const long long mod = 998244353;
const double pi = acos(-1.0);
const double eps = 1e-12;
int n;
int st;
int x[maxn], y[maxn], vis[maxn];
char s[maxn];
vector<int> p;
long long calc(long long a1, long long a2, long long b1, long long b2) {
  return a1 * b2 - a2 * b1;
}
bool rotate(int j, int i, int l) {
  long long a1 = x[j] - x[l], b1 = y[j] - y[l], a2 = x[i] - x[l],
            b2 = y[i] - y[l];
  return calc(a1, a2, b1, b2) > 0;
}
int main(int argc, char const *argv[]) {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", &x[i], &y[i]);
  scanf("%s", s + 1);
  st = 1;
  for (int i = 1; i <= n; i++) {
    if (x[i] == x[st])
      if (y[i] < y[st]) st = i;
    if (x[i] < x[st]) st = i;
  }
  vis[st] = 1;
  p.push_back(st);
  for (int i = 1; i <= n - 2; i++) {
    st = 0;
    if (s[i] == 'R') {
      for (int j = 1; j <= n; j++)
        if (vis[j] == 0) {
          if (st == 0)
            st = j;
          else if (rotate(st, j, p.back()))
            st = j;
        }
      vis[st] = 1;
      p.push_back(st);
    } else {
      for (int j = 1; j <= n; j++)
        if (vis[j] == 0) {
          if (st == 0)
            st = j;
          else if (!rotate(st, j, p.back()))
            st = j;
        }
      vis[st] = 1;
      p.push_back(st);
    }
  }
  for (int i = 1; i <= n; i++)
    if (vis[i] == 0) p.push_back(i);
  for (int i = 0; i < p.size(); i++) printf("%d ", p[i]);
  return 0;
}
