#include <bits/stdc++.h>
template <class T>
T read(T& a) {
  a = 0;
  char x = getchar();
  bool f = 0;
  for (; x < '0' || x > '9'; x = getchar()) f |= x == '-';
  for (; x >= '0' && x <= '9'; x = getchar()) a = (a << 3) + (a << 1) + x - '0';
  if (f) a = -a;
  return a;
}
using namespace std;
template <class T>
int sgn(T x) {
  return (x > 0) - (x < 0);
}
template <class T>
struct Point {
  T x, y;
  explicit Point(T x = 0, T y = 0) : x(x), y(y) {}
  bool operator<(Point p) const { return x < p.x && y < p.y; }
  bool operator==(Point p) const { return x == p.x && y == p.y; }
  Point operator+(Point p) const { return Point(x + p.x, y + p.y); }
  Point operator-(Point p) const { return Point(x - p.x, y - p.y); }
  Point operator*(T d) const { return Point(x * d, y * d); }
  Point operator/(T d) const { return Point(x / d, y / d); }
  T dot(Point p) const { return x * p.x + y * p.y; }
  T cross(Point p) const { return x * p.y - y * p.x; }
  T cross(Point a, Point b) const { return (a - *this).cross(b - *this); }
  T dist2() const { return x * x + y * y; }
  double dist() const { return sqrt((double)dist2()); }
  double angle() const { return atan2(y, x); }
  Point unit() const { return *this / dist(); }
  Point perp() const { return Point(-y, x); }
  Point normal() const { return perp().unit(); }
  Point rorate(double a) const {
    return Point(x * cos(a) - y * sin(a), x * sin(a) + y * cos(a));
  }
  friend ostream& operator<<(ostream& os, Point p) {
    return os << "(" << p.x << "," << p.y << ")";
  }
};
const int N = 3000;
Point<double> d[N];
char s[N];
bool vis[N];
int n;
int main() {
  read(n);
  int minp;
  double miny = (int)(0x3f3f3f3f);
  for (int i = 1; i <= n; ++i) {
    int a, b;
    read(a), read(b);
    if (b < miny) {
      miny = b;
      minp = i;
    }
    d[i] = Point<double>(a, b);
  }
  scanf("%s", s + 1);
  vis[minp] = 1;
  printf("%d ", minp);
  for (int i = 1; i <= n - 2; ++i) {
    int np = -1;
    for (int j = 1; j <= n; ++j) {
      if (vis[j]) continue;
      if (np == -1) {
        np = j;
      } else {
        if (s[i] == 'L') {
          if ((d[np] - d[minp]).cross(d[j] - d[minp]) < 0) {
            np = j;
          }
        } else {
          if ((d[np] - d[minp]).cross(d[j] - d[minp]) > 0) {
            np = j;
          }
        }
      }
    }
    printf("%d ", np);
    vis[np] = 1;
    minp = np;
  }
  for (int i = 1; i <= n; ++i) {
    if (!vis[i]) printf("%d\n", i);
  }
  return 0;
}
