#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using cd = complex<double>;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<cd> v(n);
  map<pair<double, double>, int> indexing;
  int value = 0;
  for (auto& x : v) {
    double a, b;
    cin >> a >> b;
    x = cd(a, b);
    indexing[make_pair(a, b)] = value++;
  }
  int which = min_element(begin(v), end(v),
                          [](cd a, cd b) { return a.real() < b.real(); }) -
              begin(v);
  auto current = v[which];
  v.erase(begin(v) + which);
  vector<cd> ret = {current};
  string s;
  cin >> s;
  reverse(begin(s), end(s));
  while (!v.empty()) {
    auto turn = s.back();
    s.pop_back();
    auto cmp = [&current](cd& x, cd& y) {
      return imag((x - current) * conj(y - current)) < 0;
    };
    auto which = (turn == 'R' ? max_element(begin(v), end(v), cmp)
                              : min_element(begin(v), end(v), cmp));
    ret.push_back(current = *which);
    v.erase(which);
  }
  for (auto x : ret) cout << indexing[make_pair(real(x), imag(x))] + 1 << ' ';
  return 0;
}
