#include <bits/stdc++.h>
using namespace std;
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
long long gcd(long long a, long long b) { return (b == 0) ? a : gcd(b, a % b); }
int main() {
  int n;
  string in;
  cin >> n >> in;
  deque<int> a, b;
  for (int i = 0; i < in.size(); ++i)
    in[i] == 'D' ? a.push_back(i + 1) : b.push_back(i + 1);
  while (!a.empty() && !b.empty()) {
    int x = a.front();
    a.pop_front();
    int y = b.front();
    b.pop_front();
    x < y ? a.push_back(n + x) : b.push_back(n + x);
  }
  cout << (b.empty() ? 'D' : 'R') << endl;
  return 0;
}
