| 2020-2021 ICPC, Moscow Subregional |
|---|
| Finished |
In this problem we will deal with byte sequences. Each byte is given by two hexadecimal digits (four bits each, eight bits in total) and is treated as an unsigned integer between $$$\t{0}$$$ and $$$\t{ff}_\t{16} = \t{255}_{\t{10}}$$$ (inclusive). Hexadecimal digits are denoted $$$\t{0123456789abcdef}$$$, as usual.
Consider the C ASCII string to be the byte sequence starting with zero or more bytes from range between $$$\t{20}_{\t{16}}$$$ and $$$\t{7f}_{\t{16}}$$$ (inclusive) followed by a zero byte. There may be arbitrary bytes following the zero byte, they are called "junk" bytes.
Consider the Pascal ASCII string to be the byte sequence starting with byte $$$l$$$ defining the length of the string, followed by $$$l$$$ bytes from range between $$$\t{20}_{\t{16}}$$$ and $$$\t{7f}_{\t{16}}$$$ (inclusive). There may be arbitrary bytes following the last of these $$$l$$$ bytes, they are also called "junk" bytes. In particular, Pascal string length is limited to the range from $$$\t{0}$$$ to $$$\t{ff}_{\t{16}} = \t{255}_{\t{10}}$$$.
You are given a memory dump as a sequence of integers $$$b_i$$$ given in hexadecimal form. Each integer belongs to the range from $$$\t{0}$$$ to $$$\t{ff}_{\t{16}}$$$ (inclusive). Your task is to determine, which of four cases takes place:
Note that in all cases junk bytes are allowed.
Input contains a sequence of no more than $$$1000$$$ space-separated hexadecimal integers; each integer consists of exactly two characters, each of which is from one of the $$$\t{0123456789abcdef}$$$ characters. In particular, leading zeroes are allowed.
If the dump can be interpreted both as a C ASCII string and as a Pascal ASCII string, print the word "Both".
If the dump can be interpreted as a C ASCII string but not as a Pascal ASCII string, print the word "C".
If the dump can be interpreted as a Pascal ASCII string but not as a C ASCII string, print the word "Pascal".
If the dump can't be interpreted as a C ASCII string or as a Pascal ASCII string, print "None".
4d 4f 53 43 4f 57 00 5a
C
04 49 43 50 43 00
Pascal
05 4e 4f 4e 45 81
None
00 f4
Both
| Name |
|---|


