#include <bits/stdc++.h>
using namespace std;
struct point {
  long long int x, y, ind;
  point() {}
  point(long long int x, long long int y) : x(x), y(y) {}
  point(long long int x, long long int y, int ind) : x(x), y(y), ind(ind) {}
};
point operator-(point p1, point p2) { return point(p1.x - p2.x, p1.y - p2.y); }
long long int prodvec(point p1, point p2) { return p1.x * p2.y - p1.y * p2.x; }
const int limit = 2005;
int n;
point v[limit];
string s;
void generate(int i) {
  if (i == n) return;
  if (s[i - 1] == 'R') {
    for (int j = i + 2; j <= n; j++)
      if (prodvec(v[i + 1] - v[i], v[j] - v[i]) > 0) swap(v[i + 1], v[j]);
  } else {
    for (int j = i + 2; j <= n; j++)
      if (prodvec(v[i + 1] - v[i], v[j] - v[i]) < 0) swap(v[i + 1], v[j]);
  }
  generate(i + 1);
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x, y;
    cin >> x >> y;
    v[i] = point(x, y, i);
  }
  cin >> s;
  for (int i = 2; i <= n; i++)
    if (v[i].x < v[1].x) swap(v[1], v[i]);
  generate(1);
  for (int i = 1; i <= n; i++) {
    if (i > 1) cout << " ";
    cout << v[i].ind;
  }
  cout << endl;
}
