#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void rd(T &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) x = x * 10 - '0' + c, c = getchar();
  x *= f;
}
const int N = 2010;
struct Point {
  long long x, y;
  Point(long long x = 0, long long y = 0) : x(x), y(y) {}
  friend Point operator-(Point A, Point B) {
    return Point(A.x - B.x, A.y - B.y);
  }
} p[N];
long long Cross(Point A, Point B) { return A.x * B.y - A.y * B.x; }
int vis[N], n;
char S[N];
int main() {
  rd(n);
  for (int i = 1; i <= n; ++i) rd(p[i].x), rd(p[i].y);
  scanf("%s", S + 1);
  S[n - 1] = 'L';
  int cur = 1;
  for (int i = 2; i <= n; ++i)
    if (p[i].x < p[cur].x) cur = i;
  printf("%d ", cur);
  vis[cur] = 1;
  for (int i = 1; i <= n - 1; ++i) {
    if (S[i] == 'L') {
      for (int j = 1; j <= n; ++j)
        if (!vis[j]) {
          int c = j;
          for (int k = j + 1; k <= n; ++k)
            if (!vis[k]) {
              if (Cross(p[c] - p[cur], p[k] - p[cur]) < 0) c = k;
            }
          printf("%d ", cur = c);
          vis[cur] = 1;
          break;
        }
    } else {
      for (int j = 1; j <= n; ++j)
        if (!vis[j]) {
          int c = j;
          for (int k = j + 1; k <= n; ++k)
            if (!vis[k]) {
              if (Cross(p[c] - p[cur], p[k] - p[cur]) > 0) c = k;
            }
          printf("%d ", cur = c);
          vis[cur] = 1;
          break;
        }
    }
  }
  return 0;
}
