#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k, l, d = 0, r = 0;
  string s;
  cin >> n >> s;
  for (int i = 0;; i++) {
    if (s[i] == 'D')
      if (r != 0)
        r--;
      else
        d++, s += s[i];
    else {
      if (s[i] == 'R')
        if (d != 0)
          d--;
        else
          r++, s += s[i];
    }
    if (d > n || r > n) {
      cout << s[i];
      break;
    }
  }
  return 0;
}
