Time limit
2s
Memory limit
128 MB
Holsoon and Jjaksoon play a number-making game. A set of N positive integers is given, and on each turn the current player must make the next positive integer: first 1, then 2, then 3, and so on. A number is made by choosing numbers from the given set and adding them together. The total number of chosen numbers used for one target may not exceed K, and numbers from the set may be reused.
For instance, if the usable numbers are 1 and 3 and K is 5, every target from 1 through 13 can be made, but 14 cannot. Because the players alternate turns and the failed target is 14, Jjaksoon is the player who cannot move, so Holsoon wins at 14.
Given the usable numbers and K, determine who wins and at which target number the game ends. The usable numbers always include 1. Although adding one more 1 to the previous construction may seem enough, the limit K makes that impossible once the construction already uses K numbers.
The first line contains N, the number of usable integers. The second line contains the N usable integers in increasing order. The third line contains K, the maximum number of chosen integers allowed for one target.
Print one line in the form holsoon win at X or jjaksoon win at X, where X is the first target number that the player to move cannot make.