#include <bits/stdc++.h>
using namespace std;
int n;
vector<pair<pair<long long int, long long int>, int> > v;
char buf[2002];
string s;
set<int> us;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    v.push_back(make_pair(make_pair(a, b), i));
  }
  sort(v.begin(), v.end());
  scanf("%s", buf);
  s = buf;
  us.insert(v[0].second);
  s.push_back('L');
  auto cur = v[0].first;
  printf("%d", v[0].second + 1);
  for (int i = 0; i < s.size(); i++) {
    int id = -1;
    pair<long long int, long long int> vec;
    pair<long long int, long long int> tmp;
    for (int j = 0; j < v.size(); j++) {
      if (us.count(v[j].second)) continue;
      auto g = make_pair(v[j].first.first - cur.first,
                         v[j].first.second - cur.second);
      if (id == -1) {
        vec = g;
        tmp = v[j].first;
        id = v[j].second;
      }
      if (s[i] == 'L') {
        if (vec.first * g.second - vec.second * g.first < 0LL) {
          id = v[j].second;
          tmp = v[j].first;
          vec = g;
        }
      } else {
        if (vec.first * g.second - vec.second * g.first > 0LL) {
          id = v[j].second;
          tmp = v[j].first;
          vec = g;
        }
      }
    }
    us.insert(id);
    if (i != -1) printf(" ");
    cur = tmp;
    printf("%d", id + 1);
  }
  puts("");
  return 0;
}
