#include <bits/stdc++.h>
using namespace std;
long long mul(pair<int, int> a, pair<int, int> b) {
  return 1LL * a.first * b.second - 1LL * a.second * b.first;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<pair<int, int> > a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first >> a[i].second;
  }
  string s;
  cin >> s;
  vector<int> ans;
  {
    int cur = 0;
    for (int i = 1; i < n; ++i) {
      if (a[i] < a[cur]) cur = i;
    }
    ans.push_back(cur);
  }
  vector<bool> used(n);
  used[ans[0]] = true;
  for (int i = 0; i < n - 2; ++i) {
    if (s[i] == 'L') {
      pair<int, int> last = {0, 0};
      int last_pos = -1;
      for (int j = 0; j < n; ++j) {
        if (used[j]) {
          continue;
        }
        pair<int, int> cur = {a[j].first - a[ans.back()].first,
                              a[j].second - a[ans.back()].second};
        if (mul(last, cur) <= 0) {
          last = cur, last_pos = j;
        }
      }
      ans.push_back(last_pos);
      used[last_pos] = true;
    } else {
      pair<int, int> last = {0, 0};
      int last_pos = -1;
      for (int j = 0; j < n; ++j) {
        if (used[j]) {
          continue;
        }
        pair<int, int> cur = {a[j].first - a[ans.back()].first,
                              a[j].second - a[ans.back()].second};
        if (mul(last, cur) >= 0) {
          last = cur, last_pos = j;
        }
      }
      ans.push_back(last_pos);
      used[last_pos] = true;
    }
  }
  for (int i = 0; i < n; ++i) {
    if (used[i]) continue;
    ans.push_back(i);
  }
  for (int i = 0; i < n; ++i) {
    cout << ans[i] + 1 << ' ';
  }
  return 0;
}
