#include <bits/stdc++.h>
using namespace std;
const long long infl = 0x3f3f3f3f3f3f3f3fLL;
const long long infi = 0x3f3f3f3f;
const long long mod = infl;
long long mygcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return mygcd(b, a % b);
}
long long mypow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
void solve() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  string temp;
  string copy;
  long long d = 0;
  long long r = 0;
  copy = s;
  while (distance(copy.begin(), unique(copy.begin(), copy.end())) != 1) {
    for (long long i = 0; i < ((long long)s.size()); i++) {
      if (s[i] == 'D' && r == 0) {
        temp.push_back('D');
        d++;
      } else if (s[i] == 'D' && r > 0) {
        r--;
      } else if (s[i] == 'R' && d == 0) {
        temp.push_back('R');
        r++;
      } else if (s[i] == 'R' && d > 0) {
        d--;
      }
    }
    s = temp;
    copy = s;
    temp.clear();
  }
  cout << s[0] << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  cin.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
