#P9048. [PA 2021] Zakłócenia
[PA 2021] Zakłócenia
Problem Description
Define a mapping from lowercase letters to 8-bit binary strings:
- Convert the ASCII code of a lowercase character into an 8-bit binary number. For example: .
Now A has a string of length that contains only lowercase letters. He maps this string into a binary string of length .
He shuffles the binary string and gets another binary string . Please restore one possible based on the shuffled result.
Input Format
The first line contains an integer .
The second line contains a binary string of length .
Output Format
If there is a solution, output one line containing a string of length consisting only of lowercase letters. Otherwise, output NIE.
If there are multiple solutions, output any one of them.
2
1100000011110111
ao
8
1011111010101100011011011010001010100011111111110001001001011010
potyczki
1
00011000
NIE
Hint
For of the testdata, .
Translated by ChatGPT 5