g | x | w | all
Bytes Lang Time Link
197197 bytes241208T180026ZNeil

197 bytes

B=lambda:input().split()
A=int
H,M,N,O,I,P,Q,J=map(A,B())
C=[I]*H
for R in range(J):K,L=map(A,B());C[K]=L
while 1:D,E,F=B();G=C[A(D)];print('BWLAOICTK'[F!=[0,'LEFT','RIGHT'][(A(E)<G)-(A(E)>G)]::2])

If while J:J-=1;K,L=map(A,B());C[K]=L works, that would save a further five bytes.