#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long n;
  cin >> n;
  vector<pair<long long, long long>> pts(n);
  vector<bool> used(n);
  for (auto &point : pts) cin >> point.first >> point.second;
  pair<long long, long long> cur = {INT32_MIN, INT32_MAX};
  string winding;
  cin >> winding;
  winding = 'L' + winding + 'L';
  for (int i = 0; i < n; i++) {
    long selected = -1;
    for (int j = 0; j < n; j++) {
      if (used[j]) continue;
      if (selected == -1) {
        selected = j;
        continue;
      }
      long long criterion =
          (pts[j].first - cur.first) * (pts[selected].second - cur.second) -
          (pts[j].second - cur.second) * (pts[selected].first - cur.first);
      if (criterion > 0 && winding[i] == 'L') selected = j;
      if (criterion < 0 && winding[i] == 'R') selected = j;
    }
    cout << selected + 1 << " ";
    used[selected] = true;
    cur = pts[selected];
  }
}
