N,Q = (int(x) for x in input().split())
s = input()
array = [1 for i in range(len(s))]
for i in range(Q):
    t,d = (x for x in input().split())
    for j in range(len(array)):
        if t == s[j]:
            if array[j] == 0:
                continue
            array[j] = 0
            if "R" == d:
                if j == len(s) - 1:
                    continue
                array[j+1] += 1
            if "L" == d:
                if j == 0:
                    continue
                array[j-1] += 1
        print(array)
