#include <bits/stdc++.h>
using namespace std;
const int N = 2002;
int n, i, j, id, x[N], y[N], it, to;
bool vis[N];
char s[N];
long long now;
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d%d", &x[i], &y[i]);
  scanf("%s", s);
  s[n - 2] = 'L';
  id = -1;
  for (i = 1; i <= n; i++)
    if (id == -1 || x[i] < x[id] || x[i] == x[id] && y[i] < y[id]) id = i;
  printf("%d ", id);
  vis[id] = 1;
  for (it = 0; it < n - 1; it++) {
    to = -1;
    for (i = 1; i <= n; i++)
      if (!vis[i])
        if (to == -1)
          to = i;
        else {
          now = 1ll * (x[i] - x[id]) * (y[to] - y[id]) -
                1ll * (x[to] - x[id]) * (y[i] - y[id]);
          if (s[it] == 'R') now = -now;
          if (now > 0) to = i;
        }
    vis[id = to] = 1;
    printf("%d ", id);
  }
}
