PROGRAMMING:Hash mapping of string keywords
Given a series of string keywords composed of capital English letters and prime number $$p $$, the hash function $$H (key) $, defined by shift method, maps the last three characters in the keyword $$key $$to integers, with each character occupying five digits; Then the integer is mapped to the hash table with the length of $$p $. For example, to insert the string 'azdeg' into a hash table with a length of 1009, we first map 26 uppercase letters to integers 0-25; Then it is mapped to $$3 / times 32 ^ 2 + 4 / times 32 + 6 = 3206 $$; Then according to the table length, $$3206% 1009 = 179 $$, which is the hash mapping position of the string.
In case of conflict, please use square detection method to solve it.
###Input format:
The first line of input first gives two positive integers $$n $$($$Le 500 $$) and $$p $$($$Ge 2n $$) which are the total number of keywords to be inserted and the length of hash table. The second line gives $$n $$string keywords, each no more than 8 digits in length, separated by spaces.
###Output format:
Output the position of each string keyword in the hash table in one row. Numbers are separated by spaces, but there must be no extra spaces at the end of the line.
###Input sample 1:
```in
4 11
HELLO ANNK ZOE LOLI
```
###Output sample 1:
```out
3 10 4 0
```
###Input sample 2:
```
6 11
LLO ANNA NNK ZOJ INNK AAA
```
###Output sample 2:
```
3 0 10 9 6 1
```
answer:If there is no answer, please comment
In case of conflict, please use square detection method to solve it.
###Input format:
The first line of input first gives two positive integers $$n $$($$Le 500 $$) and $$p $$($$Ge 2n $$) which are the total number of keywords to be inserted and the length of hash table. The second line gives $$n $$string keywords, each no more than 8 digits in length, separated by spaces.
###Output format:
Output the position of each string keyword in the hash table in one row. Numbers are separated by spaces, but there must be no extra spaces at the end of the line.
###Input sample 1:
```in
4 11
HELLO ANNK ZOE LOLI
```
###Output sample 1:
```out
3 10 4 0
```
###Input sample 2:
```
6 11
LLO ANNA NNK ZOJ INNK AAA
```
###Output sample 2:
```
3 0 10 9 6 1
```
answer:If there is no answer, please comment