import sys

num = int(input())
op = input()

if num>=4:
    top = 1
    bottom = 4
    mouse = 1
    for o in op:
        if o == 'U':
            if mouse > top:
                mouse-=1
            else:
                if top==1:
                    top = num-3
                    bottom = num
                    mouse = bottom
                else:
                    top-=1
                    bottom-=1
                    mouse-=1           
        elif o == 'D':
            if mouse < bottom:
                mouse+=1
            else:
                if bottom==num:
                    top = 1
                    bottom = 4
                    mouse = top
                else:
                    top+=1
                    bottom+=1
                    mouse+=1  
else:
    top = 1
    bottom = num
    mouse = 1
    for o in op:
        if o == 'U':
            if mouse > top:
                mouse-=1
            else:
                mouse=num      
        
        elif o == 'D':
            if mouse < bottom:
                mouse+=1
            else:
                mouse=top

print(*[x for x in range(top,bottom+1)])
print(mouse)