ss=input() res=[] ri=len(ss) li=0 for i in range(len(ss)): res.append(ss[i]) if ss[i]=='L': if ri==len(ss): res[li:i]=['L']*(i-li) else: res[ri:ri+int((i-ri+1)/2)]=['R']*int((i-ri+1)/2) res[ri+int((i-ri)/2)+1:]=['L']*int((i-ri+1)/2) ri=len(ss) li=i elif ss[i]=='R': if ri!=len(ss): res[ri:i]=['R']*(i-ri) ri=i if li<ri<len(ss): res[ri:]=['R']*(len(ss)-ri) ans=''.join(res) print(ans)