#include <bits/stdc++.h>
using namespace std;
const int MX = 2005;
int n;
string s;
vector<pair<int, int> > p, hull;
pair<int, int> act;
map<pair<int, int>, int> mp;
pair<int, int> operator-(pair<int, int> a, pair<int, int> b) {
  return {a.first - b.first, a.second - b.second};
}
long long operator^(pair<int, int> a, pair<int, int> b) {
  return 1ll * a.first * b.second - 1ll * a.second * b.first;
}
int md(pair<int, int> &o, pair<int, int> &p, pair<int, int> &q) {
  long long a = (p - o) ^ (q - o);
  return a ? (a > 0 ? 1 : -1) : 0;
}
vector<pair<int, int> > convex_hull(vector<pair<int, int> > &p) {
  sort(p.begin(), p.end());
  sort(p.begin() + 1, p.end(), [&](pair<int, int> &a, pair<int, int> &b) {
    return md(p[0], a, b) == 1;
  });
  vector<pair<int, int> > res;
  for (int i = 0; i < p.size(); i++) {
    while (res.size() > 2 && md(*(res.end() - 2), res.back(), p[i]) == -1)
      res.pop_back();
    res.push_back(p[i]);
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  p.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> p[i].first >> p[i].second;
    mp[p[i]] = i + 1;
  }
  cin >> s;
  hull = convex_hull(p);
  act = hull[0];
  for (char c : s) {
    cout << mp[act] << " ";
    int i = 0;
    while (hull[i] != act) i++;
    if (c == 'L')
      i++;
    else
      i = i - 1 + (int)hull.size();
    if (i >= hull.size()) i -= (int)hull.size();
    auto it = find(p.begin(), p.end(), act);
    act = hull[i];
    p.erase(it);
    hull = convex_hull(p);
  }
  cout << mp[act] << " ";
  if (hull[0] == act)
    cout << mp[hull[1]];
  else
    cout << mp[hull[0]];
  cout << '\n';
  return 0;
}
