#include <bits/stdc++.h>
using namespace std;
const int maxn = 2010;
int n;
struct Point {
  long long x, y;
  int id;
  Point(int _x = 0, int _y = 0, int _id = 0) : x(_x), y(_y), id(_id) {}
  void Read(int i) {
    id = i;
    scanf("%lld%lld", &x, &y);
  }
} ps[maxn];
Point operator-(Point a, Point b) { return Point(a.x - b.x, a.y - b.y); }
long long cross(Point a, Point b) { return a.x * b.y - a.y * b.x; }
Point base;
int cmp(Point a, Point b) { return cross(a - base, b - base) > 0; }
char s[maxn];
int vis[maxn], ans[maxn];
Point t[maxn];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) ps[i].Read(i);
  scanf("%s", s + 1);
  base = ps[1];
  for (int i = 2; i <= n; i++) {
    if (ps[i].y < base.y) base = ps[i];
  }
  ans[1] = base.id;
  vis[ans[1]] = 1;
  for (int i = 2; i <= n; i++) {
    int cnt = 0;
    for (int j = 1; j <= n; j++)
      if (!vis[j]) t[++cnt] = ps[j];
    sort(t + 1, t + 1 + cnt, cmp);
    if (s[i - 1] == 'L') {
      base = t[1];
      ans[i] = base.id;
      vis[ans[i]] = 1;
    } else {
      base = t[cnt];
      ans[i] = base.id;
      vis[ans[i]] = 1;
    }
  }
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  printf("\n");
  return 0;
}
