Problem A
Hipster Jazz
A new class has just started at jazz school, consisting of
It turned out to be hard for the students to choose instruments in this manner by themselves, so they turned to you for some help. Can you select an instrument for each child, such that at least half of their friends play the other instrument?
Input
The first line contains the number of students
This is followed by
The input will always be chosen in such a way that a valid selection of instruments for the students exists.
Output
Output a single string with
Scoring
Your solution will be tested on a set of test groups, each worth a number of points. To get the points for a test group you need to solve all test cases in the test group.
Group |
Points |
Constraints |
|
|
Every pair of students are friends |
|
|
|
|
|
A solution exists where no two friends play the same instrument |
|
|
No additional constraints |
Sample Input 1 | Sample Output 1 |
---|---|
3 3 1 2 1 3 2 3 |
PSP |
Sample Input 2 | Sample Output 2 |
---|---|
5 6 1 2 1 3 1 5 2 4 3 5 4 5 |
SPPSP |
Sample Input 3 | Sample Output 3 |
---|---|
6 9 1 4 1 5 1 6 2 4 2 5 2 6 3 4 3 5 3 6 |
PPPSSS |