atcoder#ARC079A. [ABC068C] Cat Snuke and a Voyage
[ABC068C] Cat Snuke and a Voyage
Score : points
Problem Statement
In Takahashi Kingdom, there is an archipelago of islands, called Takahashi Islands. For convenience, we will call them Island , Island , ..., Island .
There are kinds of regular boat services between these islands. Each service connects two islands. The -th service connects Island and Island .
Cat Snuke is on Island now, and wants to go to Island . However, it turned out that there is no boat service from Island to Island , so he wants to know whether it is possible to go to Island by using two boat services.
Help him.
Constraints
- If , .
Input
Input is given from Standard Input in the following format:
:
Output
If it is possible to go to Island by using two boat services, print POSSIBLE
; otherwise, print IMPOSSIBLE
.
3 2
1 2
2 3
POSSIBLE
4 3
1 2
2 3
3 4
IMPOSSIBLE
You have to use three boat services to get to Island .
100000 1
1 99999
IMPOSSIBLE
5 5
1 3
4 5
2 3
2 4
1 4
POSSIBLE
You can get to Island by using two boat services: Island -> Island -> Island .