Competitions

# Ternary search

# Number of elements in unimodal sequence

Sequence `a`

is called _{i}**unimodal** if there exists such index **p** that `a`

< _{1}`a`

< ... < _{2}`a`

and _{p}`a`

> _{p}`a`

> ... > _{p+1}`a`

. For the given value of _{n}**x** find how many times it appears in array.

#### Input

First line contains the size of array **n** and number of queries **q** (**n**, **q** ≤ `10`

). Next line contains ^{6}**n** positive integers that represent a unimodal sequence. Each of the next **q** lines contains value of **x**. Numbers in array do not exceed `10`

.^{9}

#### Output

For each value of **x** print in a separate line the number of times it appears in array.

Input example #1

6 4 1 5 7 8 5 1 8 1 9 5

Output example #1

1 2 0 2

Input example #2

5 3 10 9 6 3 1 1 2 3

Output example #2

1 0 1