시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB115545.455%

문제

A new class has just started at jazz school, consisting of $N$ students. Among them, $M$ pairs of students are friends. Each student has to pick an instrument to focus on during their studies, either piano or saxophone. Of course, all the students want to be very original jazz musicians. Therefore, they want to make sure that at least half of their friends choose a different instrument than what they chose.

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?

입력

The first line contains the number of students $N$ ($1 \le N \le 200$) and pairs of friends $M$ ($0 \le M \le \frac{N(N - 1)}{2}$).

This is followed by $M$ lines, one for each friendship. A friendship is described by two integers $a$ and $b$ ($1 \le a \neq b \le N$), denoting that the $a$'th and $b$'th students are friends. No friendship will be listed twice.

The input will always be chosen in such a way that a valid selection of instruments for the students exists.

출력

Output a single string with $N$ characters. The $i$'th character should denote the instrument of the $i$'th student: either P if they should play the piano, or S if they should play the saxophone.

서브태스크

번호배점제한
110

Every pair of students are friends

215

$N \le 15$

325

A solution exists where no two friends play the same instrument

450

No additional constraints

예제 입력 1

3 3
1 2
1 3
2 3

예제 출력 1

PSP

예제 입력 2

5 6
1 2
1 3
1 5
2 4
3 5
4 5

예제 출력 2

SPPSP

예제 입력 3

6 9
1 4
1 5
1 6
2 4
2 5
2 6
3 4
3 5
3 6

예제 출력 3

PPPSSS

출처

Olympiad > Nordic Olympiad in Informatics > 2022 A번

  • 문제를 만든 사람: Antti Laaksonen

채점 및 기타 정보

  • 예제는 채점하지 않는다.
  • 이 문제의 채점 우선 순위는 2이다.