#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int N;
vector<pair<pair<long long, long long>, int>> points;
long long x[2001], y[2001];
bool used[2001];
bool cmp(pair<pair<long long, long long>, int> a,
         pair<pair<long long, long long>, int> b) {
  long long cross =
      (a.first.second * b.first.first) - (b.first.second * a.first.first);
  return cross > 0;
}
int main() {
  cin >> N;
  pair<long long, long long> minY = {2001001001, 2001001001};
  int ind = -1;
  for (int i = 1; i <= N; i++) {
    cin >> x[i] >> y[i];
    if (make_pair(y[i], x[i]) < minY) {
      minY = {y[i], x[i]};
      ind = i;
    }
  }
  string s;
  cin >> s;
  cout << ind << ' ';
  used[ind] = true;
  pair<long long, long long> prevP = {x[ind], y[ind]};
  for (int i = 0; i < (int)s.length(); i++) {
    vector<pair<pair<long long, long long>, int>> angles;
    for (int j = 1; j <= N; j++)
      if (!used[j]) {
        angles.push_back({{x[j] - prevP.first, y[j] - prevP.second}, j});
      }
    sort(angles.begin(), angles.end(), cmp);
    if (s[i] == 'R') {
      int j = angles[0].second;
      cout << j << ' ';
      prevP = {x[j], y[j]};
      used[j] = true;
    } else {
      int j = angles.back().second;
      cout << j << ' ';
      prevP = {x[j], y[j]};
      used[j] = true;
    }
  }
  for (int i = 1; i <= N; i++)
    if (!used[i]) cout << i << endl;
  return 0;
}
