input() l=list(map(int,input().split())) s=input() for x in s: if x=='L':l=[l[0]+l[1]]+l[2:]+[0] else: l=[0]+l[:-2]+[l[-2]+l[-1]] print(*l)