include [HTML_REMOVED]
include [HTML_REMOVED]
include [HTML_REMOVED]
include [HTML_REMOVED]
using namespace std;
int m, n, father[110], sons, root, maxn, x, y, maxx;
int main() {
scanf(“%d%d”, &n, &m);
for (int i = 1; i <= m; i++) {
scanf("%d%d", &x, &y), father[y] = x;
}
for (int i = 1; i <= n; i++) {
if (father[i] == 0) {
root = i;
break;
}
}
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++)
if (father[j] == i)
sons++;
if (sons > maxx)
maxx = sons, maxn = i;
sons = 0;
}
printf("%d\n%d\n", root, maxn);
for (int i = 1; i <= n; i++) {
if (father[i] == maxn)
printf("%d ", i);
}
return 0;
}