#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e5 + 5;
struct Point {
  ll x, y;
  Point() {}
  Point(ll _x, ll _y) : x(_x), y(_y) {}
  Point operator-(const Point &t) const { return Point(x - t.x, y - t.y); }
  ll operator^(const Point &t) const { return x * t.y - t.x * y; }
} p[N];
bool vis[N];
int n;
char s[N];
int main() {
  cin >> n;
  int st = 1;
  for (int i = 1; i <= n; i++) {
    cin >> p[i].x >> p[i].y;
    if (p[i].y < p[st].y) st = i;
  }
  vis[st] = 1;
  cin >> s + 1;
  cout << st << " ";
  for (int cnt = 1; cnt <= n - 1; cnt++) {
    int l = -1, r = -1;
    for (int i = 1; i <= n; i++)
      if (!vis[i]) {
        if (l == -1 || ((p[l] - p[st]) ^ (p[i] - p[st])) < 0) l = i;
        if (r == -1 || ((p[r] - p[st]) ^ (p[i] - p[st])) > 0) r = i;
      }
    if (s[cnt] == 'L')
      st = l, vis[l] = 1;
    else
      st = r, vis[r] = 1;
    cout << st << " ";
  }
  cout << endl;
}
