#include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
inline int read() {
  int ans = 0;
  bool f = 1;
  char ch = getchar();
  while (!isdigit(ch)) f ^= ch == '-', ch = getchar();
  while (isdigit(ch)) ans = ((ans << 2) + ans << 1) + (ch ^ 48), ch = getchar();
  return f ? ans : -ans;
}
int n;
int x[2010], y[2010];
char s[2008];
bool vis[2010];
long long num;
int ansID = -1;
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(false);
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", &x[i], &y[i]);
  scanf("%s", s);
  s[n - 2] = 'L';
  for (int i = 1; i <= n; i++)
    if (ansID == -1 || x[i] < x[ansID] || x[i] == x[ansID] && y[i] < y[ansID])
      ansID = i;
  vis[ansID] = 1;
  printf("%d ", ansID);
  for (int i = 0; i <= n - 2; i++) {
    int nxt = -1;
    for (int j = 1; j <= n; j++)
      if (!vis[j]) {
        if (nxt == -1)
          nxt = j;
        else {
          num = 1ll * (x[j] - x[ansID]) * (y[nxt] - y[ansID]) -
                1ll * (x[nxt] - x[ansID]) * (y[j] - y[ansID]);
          if (s[i] == 'R') num = -num;
          if (num > 0) nxt = j;
        }
      }
    vis[ansID = nxt] = 1;
    printf("%d ", ansID);
  }
  return 0;
}
