P29423 [洛谷] [COCI2015-2016#1] KARTE
普及-
题目描述

Problem Description

Here is a deck of cards, but it seems to be incomplete.

You need to determine the number of missing cards for each suit.

If there are duplicate cards, output GRESKA.

Input Format

You will read a string $s$, where every three characters represent a card.

For each card:

  • The first character is the suit, denoted by P, K, H, T, and the output will be in this order.
  • The next two characters are the card's rank, with a leading zero for single-digit ranks.

Output Format

If there are duplicate cards, output GRESKA.

Otherwise, output the number of missing cards for each suit in the order P, K, H, T.

Sample Input and Output

Sample Input #1

P01K02H03H04

Sample Output #1

12 12 11 13

Sample Input #2

H02H10P11H02

Sample Output #2

GRESKA

Sample Input #3

P10K10H10T01

Sample Output #3

12 12 12 12

Notes

Sample Explanation

Sample 1 Explanation

There is one card of suit P, one card of suit K, and two cards of suit H.

Sample 2 Explanation

There are two H02 cards, so the output is GRESKA.

Data Range and Constraints

For $100\%$ of the data, it is guaranteed that $1 \le \lvert s \rvert \le 10^3$ and $s$ contains only digits and P, K, H, T, with each card's rank in the range $[1, 13]$.

Notes

This problem is worth $50$ points.

This problem is translated from the Croatian Open Competition in Informatics 2015/2016 Contest #1 T1 KARTE.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
P01K02H03H04
样例输出
12 12 11 13