#include <bits/stdc++.h>
using namespace std;
int n;
pair<pair<long long, long long>, int> p[2000];
string s;
long long ccw(pair<long long, long long> a, pair<long long, long long> b) {
  return a.first * b.second - a.second * b.first;
}
long long ccw(pair<long long, long long> a, pair<long long, long long> b,
              pair<long long, long long> c) {
  return ccw({b.first - a.first, b.second - a.second},
             {c.first - a.first, c.second - a.second});
}
int dir(char c) {
  if (c == 'L')
    return 1;
  else
    return -1;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    long long x, y;
    cin >> x >> y;
    p[i] = {{x, y}, i};
  }
  cin >> s;
  sort(p, p + n);
  for (int i = 0; i < n - 2; ++i) {
    sort(p + i + 1, p + n,
         [&](pair<pair<long long, long long>, int> a,
             pair<pair<long long, long long>, int> b) {
           return dir(s[i]) * ccw(p[i].first, a.first, b.first) > 0;
         });
  }
  for (int i = 0; i < n; ++i) cout << p[i].second + 1 << " ";
  cout << "\n";
}
