#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 5;
char op[maxn];
int vis[maxn];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    cin >> op;
    queue<int> d;
    queue<int> r;
    for (int i = 0; i < n; i++) {
      if (op[i] == 'D')
        d.push(i);
      else
        r.push(i);
    }
    memset(vis, 0, sizeof(vis));
    while (d.size() > 0 && r.size() > 0) {
      for (int i = 0; i < n; i++) {
        if (vis[i] == 1) continue;
        if (op[i] == 'D') {
          int f = d.front();
          d.pop();
          d.push(f);
          f = r.front();
          r.pop();
          vis[f] = 1;
        } else {
          if (vis[i] == 1) continue;
          int f = r.front();
          r.pop();
          r.push(f);
          f = d.front();
          d.pop();
          vis[f] = 1;
        }
        if (d.size() == 0 || r.size() == 0) break;
      }
    }
    if (d.size() == 0)
      cout << "R" << endl;
    else
      cout << "D" << endl;
  }
  return 0;
}
