DS-S95-CA3-2

Time Limit: 3 Seconds    Memory Limit: 262144 KB

Sample Input

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

Sample Output

3 
-1 
2 
Submit