CF1019C Sergey's problem

题目描述

Sergey 五岁了!当他一岁的时候,他的父母给了他一个数;当他两岁的时候,他的父母给了他一个整数数组;三岁时他收到了一个字符串;当他四岁时,他的妈妈轻轻地叫醒他,让他做一个好孩子并给了他一棵有根树。今天是他的五岁生日!他收到了一份来自父母的有向图(没有自环)。 因为他很有好奇心,他决定找出一个集合 $Q$,使得其中的点两两之间没有连边,且集合中的点可以走不超过两步到达其他所有不在集合中的点。输出任意一组解。

输入格式

输出格式

说明/提示

In the first sample, the vertices $ 1, 3, 4, 5 $ are not connected. The vertex $ 2 $ is reachable from vertex $ 1 $ by one edge. In the second sample, it is possible to reach the vertex $ 1 $ in one move and the vertex $ 2 $ in two moves. The following pictures illustrate sample tests and their answers. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1019C/8ffc83cf23fd089e5807c4ae1df3a5376736cee8.png) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1019C/62cc28df22b20845a51f4fc12a523e1a783fc9a9.png)