#include <bits/stdc++.h>
using namespace std;
int n;
string str;
long long A[2000];
long long B[2005];
int id;
bool used[2005];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%I64d %I64d", &A[i], &B[i]);
  }
  cin >> str;
  str = str + 'L';
  id = -1;
  for (int i = 0; i < n; i++) {
    if (id == -1 || A[id] > A[i] || (A[id] == A[i] && B[id] > B[i])) {
      id = i;
    }
  }
  used[id] = true;
  cout << id + 1 << " ";
  for (int i = 1; i < n; i++) {
    int to = -1;
    for (int j = 0; j < n; j++) {
      if (!used[j]) {
        if (to == -1) {
          to = j;
        } else {
          long long now = (A[j] - A[id]) * (B[to] - B[id]) -
                          (A[to] - A[id]) * (B[j] - B[id]);
          if (str[i - 1] == 'R') {
            now = -now;
          }
          if (now > 0) {
            to = j;
          }
        }
      }
    }
    used[to] = true;
    id = to;
    cout << id + 1 << " ";
  }
}
