Problem: You have a card deck of cards, numbered from top to bottom, i. e. the top card has index and bottom card — index . Each card has its color: the -th card has color .
You should process queries. The -th query is described by integer . For each query you should:
- find the highest card in the deck with color , i. e. the card with minimum index;
- print the position of the card you found;
- take the card and place it on top of the deck.
Input Format: The first line contains two integers and (; ) — the number of cards in the deck and the number of queries.
The second line contains integers () — the colors of cards.
The third line contains integers () — the query colors. It's guaranteed that queries ask only colors that are present in the deck.
Output Format: Print integers — the answers for each query.
Note: Description of the sample:
- the deck is and the first card with color has position ;
- the deck is and the first card with color has position ;
- the deck is and the first card with color has position ;
- the deck is and the first card with color has position ;
- the deck is and the first card with color has position .