The first line contains two integers $n$ and $m$ ($1 \leq n \leq 100, 1 \leq m \leq 6$) --- the number of different colors and sizes of T-shirts, respectively.

The second line contains $m$ elements --- the sizes of T-shirts delivered to Miss M. Sizes are --- \t{XS}, \t{S}, \t{M}, \t{L}, \t{XL}, \t{2XL}. It is guaranteed that the sizes are given in increasing order.

Each of the following $n$ lines contains $m$ integers $t_{i1}, t_{i2}, \dots, t_{im}$ ($0 \leq t_{ij} \leq 5 \cdot 10^{3}$) --- the number of T-shirts of the $i$-th color and $j$-th size. 

The next line contains one integer $k$ ($1 \leq k \leq 10^{5}$) --- the number of winners.

Each of the following $k$ lines contains an integer $c_i$ ($1 \leq c_i \leq n$) and a character $s_i$ --- the color and size of each T-shirt, respectively. It is guaranteed that $s_i$ is one of the $m$ sizes that were specified.

The winners' requests must be processed exactly in the order specified.