#include <bits/stdc++.h>
using namespace std;
const int len = 2005, inf = 1e9 + 5;
vector<pair<pair<int, int>, int> > vec;
pair<int, int> st;
char str[len];
long long ccw(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  return (b.first - a.first) * 1LL * (c.second - a.second) -
         (b.second - a.second) * 1LL * (c.first - a.first);
}
bool comp(pair<pair<int, int>, int> a, pair<pair<int, int>, int> b) {
  return (ccw(st, a.first, b.first) < 0);
}
void solve(int x) {
  if (vec.empty()) return;
  sort(vec.begin(), vec.end(), comp);
  int pos = 0;
  if (str[x] == 'L') pos = vec.size() - 1;
  printf("%d ", vec[pos].second);
  st = vec[pos].first;
  vec.erase(vec.begin() + pos);
  solve(x + 1);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    vec.push_back(make_pair(make_pair(a, b), i + 1));
  }
  scanf("%s", &str);
  st = make_pair(inf, inf);
  int pos = 0;
  for (int i = 0; i < vec.size(); i++)
    if (vec[i].first < st) {
      st = vec[i].first;
      pos = i;
    }
  printf("%d ", vec[pos].second);
  vec.erase(vec.begin() + pos);
  solve(0);
  return 0;
}
