Problem A
Vegaframkvæmdir
Languages
en
is
There has been a lot of road work around HÍ recently. A necessary part of these constructions is the closing of some lanes. It has gotten to the point that all roads will temporarily be made unidirectional. It is of course important to the university that everyone can still travel to their destination. Is it possible to choose a direction on all the roads such that you can get from each intersection to every other?
Input
The first line of the input consists of two integers
Output
If it is not possible to choose directions such that you can
get from each intersection to every other print ‘Ekki haegt’.
Otherwise print
Sample Input 1 | Sample Output 1 |
---|---|
5 6 1 2 3 2 3 1 4 5 3 5 3 4 |
1 2 2 3 3 1 3 5 5 4 4 3 |
Sample Input 2 | Sample Output 2 |
---|---|
6 7 1 2 2 3 3 1 4 5 5 6 6 4 4 3 |
Ekki haegt |