K. Postal code
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

There are $$$n$$$ different postal codes $$$a_1, \ldots, a_n$$$ in Barcelona. Each postal code is a $$$5$$$-digit integer (possibly with leading zeros).

Exactly one post office is responsible for each postal code. All deliveries to a specific postal code always go to the office.

Some post offices know the contact numbers and locations of each other. To make it easier to remember, they agreed on the following:

  • Post offices with numbers $$$i$$$ and $$$j$$$ ($$$1 \le i \lt j \le n$$$) will exchange contact numbers only if their postal codes $$$a_i$$$ and $$$a_j$$$ differ in exactly $$$k$$$ digits.

Recently, Tommaso came to Barcelona on vacation to work as a courier. It is very important for couriers to know the contact numbers and locations of as many post offices as possible.

Since Tommaso is not familiar with the city, he decided to start with his place of residence. He will come to the post office of his place of residence and start asking for contacts and details of other post offices. Then he will visit those offices and ask them about even more offices and so on.

Tommaso does not yet know the postal code of his place of residence. You became interested: for all possible options $$$s$$$ ($$$1 \le s \le n$$$) of the post office of Tommaso's place of residence, how many different post offices will Tommaso be able to find out about if he starts from there?

Input

The first line contains two integers $$$n$$$ and $$$k$$$ ($$$1 \leq n \leq 10^5$$$, $$$1 \leq k \leq 5$$$).

Each of the next $$$n$$$ lines contains integers $$$a_1, \dots, a_n$$$ ($$$00\,000 \le a_i \le 99\,999$$$) — all the different postal codes of Barcelona, written with exactly $$$5$$$ digits.

Output

Output exactly $$$n$$$ integers: the number of different post offices that Tommaso will be able to find out about if he starts from the office with number $$$s$$$ ($$$1 \le s \le n$$$).

Examples
Input
4 1
02345
02355
12345
85475
Output
3 3 3 1 
Input
3 5
12345
25876
57805
Output
2 2 1