#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y;
  Point(int x = 0, int y = 0) : x(x), y(y) {}
  Point operator-(const Point z) const { return Point(x - z.x, y - z.y); }
  friend long long Cross(Point a, Point b) {
    return 1ll * a.x * b.y - 1ll * a.y * b.x;
  }
} a[2010], b[2010];
bool f[2010];
char ch[2010];
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i].x >> a[i].y;
  cin >> ch;
  int p = 0;
  for (int i = 1; i < n; i++)
    if (a[i].y < a[p].y || a[i].y == a[p].y && a[i].x < a[p].x) p = i;
  f[p] = 1;
  cout << p + 1 << ' ';
  for (int i = 0; !i || ch[i - 1]; i++) {
    int x = -1;
    for (int j = 0; j < n; j++)
      if (!f[j]) {
        if (x == -1)
          x = j;
        else if (ch[i] == 'L')
          if (Cross(a[j] - a[p], a[x] - a[p]) > 0)
            x = j;
          else
            ;
        else if (Cross(a[j] - a[p], a[x] - a[p]) < 0)
          x = j;
      }
    cout << x + 1 << ' ';
    f[x] = 1;
    p = x;
  }
  return 0;
}
