#include <bits/stdc++.h>
using namespace std;
ifstream fin(".in");
ofstream fout(".out");
int n, a, b, d, k, i, j, v[200010], x, y, a1, a2, a3, b1, b2, b3;
char c, second[200010];
set<int> rep, dem;
set<int>::iterator xx;
set<pair<int, char> > all;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> second[i];
    if (second[i] == 'D')
      dem.insert(i);
    else
      rep.insert(i);
    all.insert({i, second[i]});
  }
  while (true) {
    for (auto it : all) {
      i = it.first;
      if (second[i] == 'R') {
        if (dem.lower_bound(i) != dem.end()) {
          xx = dem.lower_bound(i);
          all.erase({*xx, second[*xx]});
          dem.erase(xx);
        } else if (dem.lower_bound(0) != dem.end()) {
          xx = dem.lower_bound(0);
          all.erase({*xx, second[*xx]});
          dem.erase(xx);
        }
      } else {
        if (rep.lower_bound(i) != rep.end()) {
          xx = rep.lower_bound(i);
          all.erase({*xx, second[*xx]});
          rep.erase(xx);
        } else if (rep.lower_bound(0) != rep.end()) {
          xx = rep.lower_bound(0);
          all.erase({*xx, second[*xx]});
          rep.erase(xx);
        }
      }
      if (dem.size() == 0) {
        cout << "R";
        return 0;
      } else if (rep.size() == 0) {
        cout << "D";
        return 0;
      }
    }
  }
  return 0;
}
