import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * @author Sergey Kopeliovich (burunduk1@yandex-team.ru)
 */
public class path_sk3 {
    public static void main(String[] args) throws FileNotFoundException {
        final String fileName = "path";
        final Scanner in = new Scanner(new File(fileName + ".in"));
        final PrintWriter out = new PrintWriter(new File(fileName + ".out"));

        int n = in.nextInt();
        int m = in.nextInt();
        int c[] = new int[n];
        while (m --> 0) {
            int a = in.nextInt() - 1;
            int b = in.nextInt() - 1;
            c[b] |= 1 << a;
        }

        byte bn[] = new byte[1 << n];
        for (int pr = 0; pr < (1 << n); pr++) {
            bn[pr] = (byte)(bn[pr >> 1] + (pr & 1));
        }

        int res = -1, ra = 0;
        int p[] = new int[1 << n];
        p[0] = (1 << n) - 1;
        for (int pr = 0; pr < (1 << n) - 1; pr++) {
            int go = p[pr] & ~pr;
            if (go != 0 && bn[pr] >= res) {
                res = bn[pr];
                ra = pr;
            }
            for (int v = 0; v < n; v++)
                if (((go >> v) & 1) != 0) {
                    p[pr | (1 << v)] |= c[v];
                }
        }

        out.println(res);
        int go = p[ra] & ~ra;
        int v = 0;
        while (((go >> v) & 1) == 0)
            v++;
        ra |= 1 << v;
        while (true) {
            out.print((v + 1) + " ");
            ra ^= 1 << v;
            if (ra == 0)
                break;
            int i = 0;
            while (!(IS(ra, i) && IS(p[ra ^ (1 << i)], i) && IS(c[i], v)))
                i++;    
            v = i;
        }
        out.close();
    }

    public static boolean IS( int a, int  i ) {
        return ((a >> i) & 1) != 0;
    }
}