#include <iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<math.h>
#include<iomanip>
#include<string>
#include <cassert>
#include <complex>
#include<math.h>
#include<bits/stdc++.h>

#define rep(s,i,n) for(int i = s;i < n;i++)
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef __int128_t lll;
typedef pair<ll, ll> pll;
 
const int dx[] = { 0,1,0,-1 };
const int dy[] = { 1,0,-1,0 };
const ll LongINF = 1e13 + 7;
const int INF = 1e9 + 7;
const ll LL_MAX = 9223372036854775807;
const ll LL_MIN = -9223372036854775807;
//エッジが保持する情報
struct E{
  int y;
  int d;
  int c;
  E(int y,int d,int c) : y(y) , d(d), c(c) {}
} ;

//ノード一つが取り扱う情報
struct S{
  double time;
  int sp,city,prev;
  //コンストラクタ
  S(double time,int sp, int city, int prev) : time(time),sp(sp),city(city),prev(prev) {}
  bool operator > (const S & s) const{
    return time > s.time;
  }
};

int dsp[3] = {-1,0,1};

int keta(ll i){

  int keta = 0;
  do{
    keta++;
  }while(i /= 10);

  return keta;
}
//素因数分解　O(√n)
vector<pair<ll,ll>> pfactor(ll n){
  vector<pair<ll,ll>> factor;
   ll ex; //指数
   for(ll a = 2; a * a <= n; a++){
     if(n % a != 0)continue;

     ll ex = 0;

     while(n % a == 0){
       n /= a;
       ex++;
     }

     factor.push_back({a,ex});
   }

   if(n != 1) factor.push_back({n,1});

  return factor; 
}

int charCheck(char c){
  int f;
  if(c >= 'a' && c <= 'z')f = 1;
  else if(c >= 'A' && c <= 'Z') f = 0;

  return f;
}



 
int main(void){

  string s;
  cin >> s;

  rep(1,i,s.size() + 1){
    if(i%2 != charCheck(s[i-1]))
    {
      cout << "No" ;
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
#include <bits/stdc++.h>
#include<sstream>
#include<string>
#include<vector>
#include <set>
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define mp make_pair
#define ll long long
#define lb lower_bound
#define ub upper_bound
#define endl "\n"
#define ff first
#define ss second
#define decimal(ans,w) cout<<fixed<<setprecision(w)<<ans
long long M=1000000007;
using namespace std;
ll fact[10000];
ll power(ll x, unsigned ll y, unsigned ll m) 
{ 
    if (y == 0) 
        return 1; 
    ll p = power(x, y / 2, m) % m; 
    p = (p * p) % m; 
  
    return (y % 2 == 0) ? p : (x * p) % m; 
} 
unsigned long long modInverse(unsigned long long n,  
                                            ll p)
{
    return power(n, p - 2, p);
}
unsigned long long nCrModPFermat(unsigned long long n,
                                 ll r, ll p)
{
    // If n<r, then nCr should return 0
    if (n < r)
        return 0;
    // Base case
    if (r == 0)
        return 1;
    return (fact[n] * modInverse(fact[r], p) % p
            * modInverse(fact[n - r], p) % p)
           % p;
}
int32_t main()
{
  IOS
  string s;
  cin>>s;
  ll n=s.length(),x=0;
  deque<char>t;
  for(ll i=0;i<n;i++)
  {
      if(s[i]=='R')
      {
         x^=1; 
      }
      else if(x)t.push_front(s[i]);
      else t.push_back(s[i]);
  }
  if(x)reverse(t.begin(),t.end());
  string s1;
  for(auto it:t)
  {
      if(s1.length()>0 && s1.back()==it)
      {
          s1.pop_back();
      }
      else s1.push_back(it);
  }
  cout<<s1;
  return 0;
}
