F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

wyh2000 and pupil

Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)
Total Submission(s): 2618    Accepted Submission(s): 837


Problem Description
Young theoretical computer scientist wyh2000 is teaching his pupils.

Wyh2000 has n pupils.Id of them are from $1$ to $n$.In order to increase the cohesion between pupils,wyh2000 decide to divide them into 2 groups.Each group has at least 1 pupil.

Now that some pupils don't know each other(if $a$ doesn't know $b$,then $b$ doesn't know $a$).Wyh2000 hopes that if two pupils are in the same group,then they know each other,and the pupils of the first group must be as much as possible.

Please help wyh2000 determine the pupils of first group and second group. If there is no solution, print "Poor wyh".
 

Input
In the first line, there is an integer $T$ indicates the number of test cases.

For each case, the first line contains two integers $n,m$ indicate the number of pupil and the number of pupils don't konw each other.

In the next m lines,each line contains 2 intergers $x,y(x$<$y)$,indicates that $x$ don't know $y$ and $y$ don't know $x$,the pair $(x,y)$ will only appear once.

$T\leq10,0\leq n,m\leq100000$
 

Output
For each case, output the answer.
 

Sample Input
2 8 5 3 4 5 6 1 2 5 8 3 5 5 4 2 3 4 5 3 4 2 4
 

Sample Output
5 3 Poor wyh
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-29 14:58:48, Gzip enabled