#include <bits/stdc++.h>
using namespace std;
class Point {
 public:
  int x, y;
  Point(int _x, int _y) : x(_x), y(_y) {}
  bool operator==(const Point& other) const {
    return make_pair(x, y) == make_pair(other.x, other.y);
  }
  bool operator!=(const Point& other) const { return !(*this == other); }
  bool operator<(const Point& other) const {
    return make_pair(x, y) < make_pair(other.x, other.y);
  }
};
long long cross(Point origin, Point a, Point b) {
  return (long long)(a.x - origin.x) * (b.y - origin.y) -
         (long long)(a.y - origin.y) * (b.x - origin.x);
}
vector<Point> Pv;
bool cmp(int lhs, int rhs) { return Pv[lhs] < Pv[rhs]; }
vector<int> ConvexHull(vector<int> a) {
  sort(a.begin(), a.end(), cmp);
  int n = a.size();
  if (n == 1) return a;
  vector<int> down = {a[0]}, up = {a[n - 1]};
  for (int i = 1; i < n; i++) {
    while ((int)down.size() >= 2 && cross(Pv[down[(int)down.size() - 2]],
                                          Pv[down.back()], Pv[a[i]]) <= 0)
      down.pop_back();
    down.push_back(a[i]);
  }
  down.pop_back();
  for (int i = n - 2; i >= 0; i--) {
    while ((int)up.size() >= 2 &&
           cross(Pv[up[(int)up.size() - 2]], Pv[up.back()], Pv[a[i]]) <= 0)
      up.pop_back();
    up.push_back(a[i]);
  }
  up.pop_back();
  vector<int> ans = down;
  ans.insert(ans.end(), up.begin(), up.end());
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  Pv.reserve(n);
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    Pv.emplace_back(x, y);
  }
  string s;
  cin >> s;
  s += 'L';
  vector<int> ans;
  vector<int> vis(n, 0);
  for (int i = 0; i < n - 1; i++) {
    vector<int> avail;
    for (int j = 0; j < n; j++) {
      if (!vis[j]) avail.push_back(j);
    }
    vector<int> hull = ConvexHull(avail);
    if (!i) {
      if (s[0] == 'L') {
        vis[hull[0]] = 1;
        ans.push_back(hull[0]);
        ans.push_back(hull[1]);
      } else {
        vis[hull[1]] = 1;
        ans.push_back(hull[1]);
        ans.push_back(hull[0]);
      }
      continue;
    }
    int last = ans.back();
    vis[last] = 1;
    for (int j = 0; j < (int)hull.size(); j++) {
      if (hull[j] == last) {
        int pos;
        if (s[i] == 'L') {
          pos = j + 1;
        } else
          pos = j - 1;
        pos %= (int)hull.size();
        if (pos < 0) pos += (int)hull.size();
        ans.push_back(hull[pos]);
        break;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] + 1 << ' ';
  }
  cout << '\n';
  return 0;
}
