#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
struct pt {
  ll x, y;
  pt() : x(0), y(0) {}
  pt(ll x, ll y) : x(x), y(y) {}
  pt operator-(pt p) { return {x - p.x, y - p.y}; }
  ll operator*(pt p) { return x * p.y - y * p.x; }
  ll operator<(pt p) { return tie(x, y) < tie(p.x, p.y); }
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<pair<pt, int>> a(n);
  for (int i = 0; i < (n); i++) {
    cin >> a[i].first.x >> a[i].first.y;
    a[i].second = i + 1;
    if (a[i].first < a[0].first) swap(a[0], a[i]);
  }
  string s;
  cin >> s;
  for (int i = 0; i < (n - 2); i++) {
    for (int j = i + 1; j < n; j++) {
      if ((a[j].first - a[i].first) * (a[i + 1].first - a[i].first) > 0 ==
          (s[i] == 'L'))
        swap(a[i + 1], a[j]);
    }
  }
  for (int i = 0; i < (n); i++) cout << a[i].second << ' ';
}
