#include <bits/stdc++.h>
using namespace std;
int const N = 2000;
char s[N];
bool vis[N];
struct P {
  int x, y, id;
  P() {}
  P(int a, int b) : x(a), y(b) {}
  void sc(int i) {
    scanf("%d%d", &x, &y);
    id = i;
  }
  P operator-(P const &o) const { return P(x - o.x, y - o.y); }
  long long operator|(P const &o) const {
    return (long long)x * o.y - (long long)o.x * y;
  }
  bool operator<(P const &o) const {
    if (x == o.x) return y < o.y;
    return x < o.x;
  }
} p[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < (int)(n); ++i) p[i].sc(i);
  sort(p, p + n);
  scanf("%s", s);
  printf("%d", p[0].id + 1);
  vis[0] = true;
  int lst = 0, m = n - 1;
  s[m - 1] = 'L';
  for (int i = 0; i < (int)(m); ++i) {
    int l = -1, r = -1;
    for (int j = 0; j < (int)(n); ++j)
      if (!vis[j]) {
        if (l == -1)
          l = r = j;
        else if (((p[j] - p[lst]) | (p[r] - p[lst])) > 0)
          r = j;
        else if (((p[l] - p[lst]) | (p[j] - p[lst])) > 0)
          l = j;
      }
    if (s[i] == 'L')
      lst = r;
    else
      lst = l;
    printf(" %d", p[lst].id + 1);
    vis[lst] = true;
  }
  printf("\n");
}
