#include <bits/stdc++.h>
using namespace std;
char arr[200010];
int active[200010];
char solve(int n) {
  int ds = 0;
  int rs = 0;
  for (int i = 0; i < n; i++) {
    if (arr[i] == 'D')
      ds++;
    else
      rs++;
  }
  for (int i = 0; i < n; i++) {
    active[i] = 1;
  }
  int cur_ind = 0;
  int cur_d = 0;
  int cur_r = 0;
  while (true) {
    for (int i = 0; i < n; i++) {
      if (active[i] == 0) continue;
      if (arr[i] == 'D') {
        if (cur_r > 0) {
          active[i] = 0;
          cur_r--;
          ds--;
        } else {
          cur_d++;
        }
      } else {
        if (cur_d > 0) {
          active[i] = 0;
          cur_d--;
          rs--;
        } else {
          cur_r++;
        }
      }
    }
    if (ds == 0 || rs == 0) break;
  }
  if (ds > 0) return 'D';
  return 'R';
}
int main() {
  int n;
  cin >> n;
  scanf("%s", arr);
  char res = solve(n);
  cout << res << endl;
  return 0;
}
