#include <bits/stdc++.h>
using std::abs;
using std::array;
using std::cerr;
using std::cin;
using std::cout;
using std::generate;
using std::get;
using std::make_pair;
using std::make_tuple;
using std::map;
using std::max;
using std::max_element;
using std::min;
using std::min_element;
using std::pair;
using std::reverse;
using std::set;
using std::sort;
using std::string;
using std::swap;
using std::tuple;
using std::unique;
using std::vector;
template <typename T>
T input() {
  T res;
  cin >> res;
  {};
  return res;
}
template <typename IT>
void input_seq(IT b, IT e) {
  std::generate(b, e,
                input<typename std::remove_reference<decltype(*b)>::type>);
}
int64_t cross(pair<int64_t, int64_t> a, pair<int64_t, int64_t> b) {
  return int64_t(a.first) * b.second - int64_t(a.second) * b.first;
}
pair<int64_t, int64_t> sub(pair<int64_t, int64_t> a, pair<int64_t, int64_t> b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
int32_t main() {
  std::iostream::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int64_t n = input<int64_t>();
  vector<pair<int64_t, int64_t>> coords(n);
  for (int64_t i = 0; i != n; ++i) {
    cin >> coords[i].first >> coords[i].second;
  }
  string s = input<string>();
  vector<char> used(n);
  int64_t start =
      std::min_element(coords.begin(), coords.end()) - coords.begin();
  vector<int64_t> ans = {start};
  used[start] = 1;
  for (int64_t it = 0; it != n - 2; ++it) {
    int64_t optimal = -1;
    for (int64_t i = 0; i != n; ++i)
      if (not used[i])
        if (optimal == -1 or cross(sub(coords[i], coords[ans.back()]),
                                   sub(coords[optimal], coords[ans.back()])) *
                                     (s[it] == 'L' ? +1 : -1) >
                                 0)
          optimal = i;
    ans.push_back(optimal);
    used[optimal] = 1;
  }
  for (int64_t i = 0; i != n; ++i)
    if (not used[i]) ans.push_back(i);
  for (int64_t elem : ans) cout << elem + 1 << " ";
  cout << "\n";
  return 0;
}
