#include <bits/stdc++.h>
using namespace std;
pair<int, int> p[2010];
double eps = 1e-8, PI = acos(-1.0);
int sgn(double x) {
  if (fabs(x) < eps) return 0;
  if (x < 0) return -1;
  return 1;
}
int vis[2010];
char s[2010];
long long cross(pair<int, int> a, pair<int, int> b) {
  return 1ll * a.first * b.second - 1ll * a.second * b.first;
}
pair<int, int> sub(pair<int, int> a, pair<int, int> b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = (1); i <= (n); i++) scanf("%d%d", &p[i].first, &p[i].second);
  scanf("%s", s + 1);
  s[n - 1] = 'L';
  int k = 1;
  for (int i = (2); i <= (n); i++)
    if (p[i].second < p[k].second)
      k = i;
    else if (p[i].second == p[k].second && p[i].first < p[k].second)
      k = i;
  vis[k]++;
  printf("%d%c", k, ' ');
  for (int now = (1); now <= (n - 1); now++) {
    int to = 0;
    for (int i = (1); i <= (n); i++)
      if (!vis[i]) {
        if (!to)
          to = i;
        else {
          long long x = cross(sub(p[i], p[k]), sub(p[to], p[k]));
          if (s[now] == 'L') {
            if (x > 0) to = i;
          } else {
            if (-x > 0) to = i;
          }
        }
      }
    printf("%d%c", to, ' ');
    vis[to]++;
    k = to;
  }
}
