PivotOJ

Fair Play

시간 제한: 2000ms메모리 제한: 1024MB출처: BAPC 2021BOJ 23380

문제

Together with your coworker, Larry, you are organizing the exciting Billiards and Pool Competition for your coworkers in your small company. You and Larry are usually on the same page, and surely he will approve of your latest idea. You even bought a nice prize for your coworkers to win and you hope that they are as excited as you are. You want to maximise fun.

It would thus be nice to try to avoid complete walkovers: that is no fun for either player. After some thought, you think it is good to suggest to Larry to divide the players into groups of two. That way, you can compensate for a player's strength by pairing them with a weaker player. In fact, it would be perfect if every team had the exact same strength! Before you tell Larry your plans, you decide to first figure out whether this is possible.

According to your model, synergy plays a negligible role in determining team strength, and the strength of a team is simply determined by the strength of its individual members. Every coworker has a certain skill level in both billiards and pool, as indicated by two integers. When two coworkers are teamed up, their total skill is the sum of their individual skills. Can you divide everyone into teams of two such that every team has the exact same skill in both pool and billiards?

입력

The input consists of:

  • A line with an integer nn (2n1052\leq n\leq 10^5), the number of coworkers you have.
  • Then follow nn lines containing two integers bb and pp (106b,p106-10^6 \leq b, p \leq 10^6), the skill in billiards and pool, respectively, of each coworker.

출력

Output "possible" if it is possible to divide all coworkers into teams of two with equal skill. Output "impossible" otherwise.

예제

예제 1

입력
6
2 1
3 0
3 0
4 2
4 2
5 1
출력
possible

예제 2

입력
4
1 0
0 1
-2 0
0 -2
출력
impossible
코드를 제출하려면 로그인하세요.