The first line contains two integers $n,m\,(1 \le n,m \le 1\,000)$, denoting the size of the mirror maze.
Each of the following $n$ lines contains a string of length $m$, where the $j$\-th character in the $i$\-th line $S_{i,j}\,(S_{i,j} \in \{|, -, /, \backslash\})$ denotes the mirror on grid $(i,j)$.
The next line contains an integer $q\,(1 \le q \le 10^5)$, denoting the number of light sources.
Each of the following $q$ lines contains two integers $u\,(1 \le u \le n)$, $v\,(1 \le v \le m)$ and a string $dir\,(dir \in \{above, below, left, right\})$, denoting that a light source is on grid $(u,v)$ and emits light going along the $dir$ direction. Specifically, the light will not be influenced by the mirror on grid $(u,v)$ initially.