#include <bits/stdc++.h>
std::vector<long long> x, y;
std::vector<bool> used;
int getNext(int c, bool max) {
  int next = -1;
  long double mcos = max ? 1 : -1;
  for (int j = 0; j < used.size(); ++j) {
    if (used[j]) continue;
    if (next == -1) {
      next = j;
      continue;
    }
    long long nvx = x[j] - x[c];
    long long nvy = y[j] - y[c];
    long long cvx = x[next] - x[c];
    long long cvy = y[next] - y[c];
    long long vp = cvx * nvy - cvy * nvx;
    if (max && vp < 0 || !max && vp > 0) {
      next = j;
    }
  }
  return next;
}
int main() {
  int n;
  scanf("%d", &n);
  x = std::vector<long long>(n);
  y = std::vector<long long>(n);
  for (int i = 0; i < n; ++i) scanf("%I64d %I64d", &x[i], &y[i]);
  char b[2000];
  scanf("%2000s", b);
  std::string d(b);
  used = std::vector<bool>(n);
  int f = 0;
  for (int i = 0; i < n; ++i) {
    if (y[i] < y[f] || y[i] == y[f] && x[i] < x[f]) {
      f = i;
    }
  }
  int p = f;
  used[p] = true;
  printf("%d ", p + 1);
  int c = getNext(f, d[0] == 'L');
  for (int i = 1; i < n - 2; ++i) {
    used[c] = true;
    long long cvx = x[c] - x[p];
    long long cvy = y[c] - y[p];
    long long cvm = sqrtl(cvx * cvx + cvy * cvy);
    int next = getNext(c, d[i] == 'L');
    printf("%d ", c + 1);
    p = c;
    c = next;
  }
  printf("%d ", c + 1);
  used[c] = true;
  for (int i = 0; i < n; ++i) {
    if (!used[i]) {
      printf("%d", i + 1);
      break;
    }
  }
}
