#include <bits/stdc++.h>
const int MAXN = 2000 + 5;
int n;
struct Node {
  long long x, y;
  int id;
  Node(long long x = 0, long long y = 0, int id = 0) : x(x), y(y), id(id) {}
  inline bool operator<(const Node &t) const { return x < t.x; }
  inline Node operator-(const Node &t) const { return Node(x - t.x, y - t.y); }
  inline long long operator*(const Node &t) const { return x * t.y - y * t.x; }
} a[MAXN];
int b[MAXN];
bool del[MAXN];
inline int find(int x, int o) {
  int res = -1;
  for (int i = 1; i <= n; ++i) {
    if (i == x || del[i]) continue;
    if (res == -1)
      res = i;
    else if (((a[res] - a[x]) * (a[i] - a[x]) > 0) ^ o)
      res = i;
  }
  return res;
}
char str[MAXN];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%lld%lld", &a[i].x, &a[i].y), a[i].id = i;
  std::sort(a + 1, a + n + 1);
  int las = 1;
  b[1] = a[1].id;
  del[1] = 1;
  scanf("%s", str + 1);
  for (int i = 1; i <= n - 2; ++i) {
    int t = find(las, str[i] == 'L');
    b[i + 1] = a[t].id;
    las = t;
    del[las] = 1;
  }
  for (int i = 1; i <= n; ++i)
    if (!del[i]) b[n] = a[i].id;
  for (int i = 1; i <= n; ++i) printf("%d ", b[i]);
  puts("");
  return 0;
}
