using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PetljaTakmicenje
{
    class Program
    {

        static void Main(string[] args)
        {
            bool[,] b = new bool[200000, 200000];
            b[1, 2] = true;
            string[] s = Console.ReadLine().Split();
            int n = int.Parse(s[0]), m = int.Parse(s[1]);
            bool[] t = new bool[n];
            List<int>[] a = new List<int>[n];
            
            for (int i = 0; i < n; i++)
            {
                a[i] = new List<int>();
            }
            for (int i = 0; i < m; i++)
            {
                s = Console.ReadLine().Split();
                a[int.Parse(s[0]) - 1].Add(int.Parse(s[1]) - 1);
            }
        }
    }
}