시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 256 MB 233 212 199 92.130%

문제

JOI는 친구 1 부터 친구 N 까지 총 N 명의 친구와 함께, 크리스마스 파티에 갔습니다. 크리스마스 파티 분위기도 달아오르니, JOI는 친구들과 함께 다음과 같은 게임을 하기로 했습니다.

  1. 가장 먼저, JOI는 N명의 친구 중 한명을 선택합니다. 이제 그 친구를 '타겟'이라고 부릅시다.
  2. JOI는 타겟으로 고른 친구에게, 타겟이 되었다는 것을 몰래 알려줍니다. 타겟이 아닌 친구들은 누가 타겟인지 알 수 없습니다.
  3. 타겟이 아닌 친구들은 각자 타겟이 누구일까 생각해서, 그 사람의 이름을 종이에 씁니다. 타겟은 자기자신의 이름을 종이에 씁니다.
  4. 모든 사람이 종이에 이름을 썼다면, JOI는 타겟의 이름을 발표합니다.
  5. 예상이 맞은 사람은 1점을 얻습니다. 당연히, 타겟은 자신의 이름을 적었으므로, 반드시 1점을 얻습니다. 예상이 빗나간 사람은 점수를 주지 않습니다.
  6. 추가로, 예상이 빗나간 사람의 수가 X명일 경우, 타겟은 추가로 X점을 얻습니다.
 JOI와 친구들은 이 게임을 M번 했습니다. M번의 게임을 했을 때, 각 친구들의 합계 점수를 구하세요.

입력

입력은 총 3 + M 줄이 주어집니다.

첫번째 줄에는, 친구들의 수 N (3 ≦ N ≦ 100)이 주어집니다.

두번째 줄에는, JOI와 친구들이 했던 게임의 횟수 M (3 ≦ M ≦ 100)이 주어집니다.

세번째 줄에는, M개의  정수 A1, A2, ...,  AM 이 공백을 사이에 두고 주어집니다. i 번째 (1 ≦ i ≦ M) 게임의 타겟이 친구 Ai (1 ≦ Ai ≦ N) 라는 것을 나타냅니다.

이어지는 M개의 줄 중 i번째 (1 ≦ i ≦ M) 줄에는, N개의 정수 Bi,1, Bi,2, ..., Bi,N 가 공백을 사이에 두고 주어집니다. 이것은 i 번째 게임에서 친구 j (1 ≦ j ≦ N)가 친구 Bi,j (1 ≦ Bi,j ≦ N)의 이름을 종이에 썼다는 것을 의미합니다. 타겟은 자신의 이름을 종이에 쓰도록 되어 있으므로, j = Ai 이면, 반드시 Bi,j = j 입니다.

출력

M 번의 게임에서, 각각의 친구들이 얻은 합계 점수를 출력하세요.

총 N 줄의 출력에서,  j 번째 (1 ≦ j ≦ N)  줄에는 친구 j의 합계 점수를 출력하세요

예제 입력 1

3
4
1 2 3 2
1 1 2
3 2 2
1 1 3
2 2 2

예제 출력 1

3
4
5

예제 입력 2

5
3
3 3 1
2 4 3 3 3
4 3 3 3 1
1 3 4 1 1

예제 출력 2

3
1
6
3
2

힌트

첫번째 예제의 경우, 3명의 친구가 4번의 게임을 합니다.

  • 첫번째 게임의 타겟은 '친구 1'이므로, 친구 1 은 2점, 친구 2 는 1점, 친구 3 은 0점을 얻습니다.
  • 두번째 게임의 타겟은 '친구 2'이므로, 친구 1 은 0점, 친구 2 는 2점, 친구 3 은 1점을 얻습니다.
  • 세번째 게임의 타겟은 '친구 3'이므로, 친구 1 은 0점, 친구 2 는 0점, 친구 3 은 3점을 얻습니다.
  • 네번째 게임의 타겟은 '친구 2'이므로, 친구 1 은 1점, 친구 2 는 1점, 친구 3 은 1점을 얻습니다.

4번의 게임 종료 후의 합계 점수는, 친구 1 은 3점, 친구 2 는 4점, 친구 3은 5점이 됩니다.

W3sicHJvYmxlbV9pZCI6IjEwNzA4IiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVkMDZjXHViOWFjXHVjMmE0XHViOWM4XHVjMmE0IFx1ZDMwY1x1ZDJmMCIsImRlc2NyaXB0aW9uIjoiPHA+Sk9JXHViMjk0IFx1Y2U1Y1x1YWQ2YyAxIFx1YmQ4MFx1ZDEzMCBcdWNlNWNcdWFkNmMgTiBcdWFlNGNcdWM5YzAgXHVjZDFkIE4gXHViYTg1XHVjNzU4IFx1Y2U1Y1x1YWQ2Y1x1YzY0MCBcdWQ1NjhcdWFlZDgsIFx1ZDA2Y1x1YjlhY1x1YzJhNFx1YjljOFx1YzJ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