#include <bits/stdc++.h>
using namespace std;
int n;
pair<pair<int, int>, int> A[2000];
string w;
long long fi(pair<int, int>& p1, pair<int, int>& p2, pair<int, int>& p3) {
  long long x1 = p2.first - p1.first, x2 = p3.first - p2.first,
            y1 = p2.second - p1.second, y2 = p3.second - p2.second;
  return x1 * y2 - y1 * x2;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> A[i].first.first >> A[i].first.second;
    A[i].second = i + 1;
  }
  cin >> w;
  int opt = 0;
  for (int i = 1; i < n; i++)
    if (A[i].first.first < A[opt].first.first) opt = i;
  swap(A[opt], A[0]);
  for (int i = 0; i < n - 2; i++) {
    opt = i + 1;
    for (int j = i + 2; j < n; j++)
      if ((w[i] == 'L' && fi(A[i].first, A[opt].first, A[j].first) < 0) ||
          (w[i] == 'R' && fi(A[i].first, A[opt].first, A[j].first) > 0))
        opt = j;
    swap(A[i + 1], A[opt]);
  }
  for (int i = 0; i < n; i++) cout << A[i].second << " ";
  cout << endl;
  return 0;
}
