#include <bits/stdc++.h>
using namespace std;
int n, lst = -1;
bool vis[2000];
int s[2001], top;
char opt[2000];
struct point {
  int x, y, id;
} p[2000];
inline double slope(int i, int j) {
  if (p[s[i]].x == p[s[j]].x)
    return p[s[i]].y < p[s[j]].y ? 2e9 : -2e9;
  else
    return 1.0 * (p[s[i]].y - p[s[j]].y) / (p[s[i]].x - p[s[j]].x);
}
inline bool comp(point a, point b) { return a.x < b.x; }
void Get(void) {
  top = -1;
  for (int i = 0; i < n; i++) {
    if (vis[i] == 1) continue;
    s[2000] = i;
    while (top > 0 && slope(top - 1, top) < slope(top, 2000)) top--;
    s[++top] = i;
  }
  int x = top;
  for (int i = n - 1; i >= 0; i--) {
    if (vis[i] == 1) continue;
    s[2000] = i;
    while (top > x && slope(top, top - 1) < slope(2000, top)) top--;
    s[++top] = i;
  }
  return;
}
int main(void) {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &p[i].x, &p[i].y);
    p[i].id = i + 1;
  }
  sort(p, p + n, comp);
  scanf(" %s", opt);
  Get();
  lst = s[0];
  printf("%d", p[s[0]].id);
  for (int i = 1; i < n; i++) {
    Get();
    vis[lst] = 1;
    for (int j = 0; j < top; j++)
      if (s[j] == lst) {
        if (opt[i - 1] == 'L')
          lst = s[(j - 1 + top) % top];
        else
          lst = s[(j + 1) % top];
        break;
      }
    printf(" %d", p[lst].id);
  }
  putchar('\n');
  return 0;
}
