LogiQuest

362. Lottery Matches

EasySet

Print how many of a ticket's numbers appear in the winning numbers, and the prize: 6 → JACKPOT, 5 → 1000, 4 → 100, 3 → 10, fewer → 0.

Input format

Line 1: 6 winning numbers Line 2: 6 ticket numbers

Output format

matches prize

Example 1

Input

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

Output

6 JACKPOT

Example 2

Input

1 2 3 4 5 6
1 2 3 10 11 12

Output

3 10

Constraints

Numbers 1–49, distinct within each line.

Read input from standard input and print the answer to standard output. Your code is judged against 3 test cases, most of them hidden.

Loading the MyLoginn IDE…