Consecutive N-Poker

We have a sequence of Poker cards, and we want to know if at any point in the sequence there are NN consecutive identical cards (an "N-Consecutive Poker"). Write a program that reads a sequence of cards and determines whether the sequence has NN consecutive identical cards.

Input

The input begins with a natural number NN, with N>0N > 0. Then comes a sequence of characters representing the cards in the sequence. As in the problem "Poker Hand", the characters for the cards are A for 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 for 10, J, Q, and K. It is guaranteed that the sequence of cards has at least one card.

Output

Write "NN-Poker of xx!" if the sequence has NN consecutive cards of the same value xx. Otherwise, write "No NN-Poker". For example, if NN is 7, and we find 7 repetitions of the card K, the output will be "7-Poker of K!", but if there is no such repetition, the output will be "No 7-Poker". The output only shows the first consecutive NN-Poker found, with its corresponding xx, even though there might be more consecutive NN-Pokers in the sequence.

Observation

In this problem, you need to process the input character by character. If you use strings or any method to store the data, the problem will be considered invalid. Also, keep in mind that the sequence comes from an unlimited source of cards, so no maximum length can be assumed.

Problem information

Author: PRO1

Generation: 2026-01-25T13:09:19.440Z

© Jutge.org, 2006–2026.
https://jutge.org