#include <bits/stdc++.h>
using namespace std;
struct P {
  long long x, y;
  int id;
  P(){};
  P(long long _x, long long _y) : x(_x), y(_y){};
  P operator-(const P& b) const { return P{x - b.x, y - b.y}; }
  void operator+=(const P& b) { x += b.x, y += b.y; }
  long long operator*(const P& b) const { return x * b.y - y * b.x; }
  long long cross(const P& b, const P& c) const {
    return (b - *this) * (c - *this);
  }
  bool isRight() const { return x > 0 || (x == 0 && y > 0); }
  bool operator<(const P& b) const {
    if (isRight() != b.isRight()) return isRight();
    if (*this * b == 0) {
      return make_pair(abs(x), abs(y)) < make_pair(abs(b.x), abs(b.y));
    }
    return *this * b < 0;
  }
  bool operator==(const P& b) const {
    return make_pair(x, y) == make_pair(b.x, b.y);
  }
};
int n;
string s;
int main() {
  cin >> n;
  vector<P> cur(n);
  for (int i = 0; i < n; i++) {
    cin >> cur[i].x >> cur[i].y;
    cur[i].id = i;
  }
  cin >> s;
  vector<P> res;
  auto it =
      min_element(cur.begin(), cur.end(), [&](P a, P b) { return a.y < b.y; });
  res.push_back(*it);
  cur.erase(it);
  for (int i = 0; i < n - 2; i++) {
    sort(cur.begin(), cur.end(),
         [&](P a, P b) { return res.back().cross(a, b) < 0; });
    it = (s[i] == 'L' ? prev(cur.end()) : cur.begin());
    res.push_back(*it);
    cur.erase(it);
  }
  res.push_back(cur[0]);
  for (auto i : res) cout << i.id + 1 << " ";
  return 0;
}
