Problem: A famous sculptor Cicasso goes to a world tour!

Well, it is not actually a world-wide. But not everyone should have the opportunity to see works of sculptor, shouldn't he? Otherwise there will be no any exclusivity. So Cicasso will entirely hold the world tour in his native country — Berland.

Cicasso is very devoted to his work and he wants to be distracted as little as possible. Therefore he will visit only four cities. These cities will be different, so no one could think that he has "favourites". Of course, to save money, he will chose the shortest paths between these cities. But as you have probably guessed, Cicasso is a weird person. Although he doesn't like to organize exhibitions, he likes to travel around the country and enjoy its scenery. So he wants the total distance which he will travel to be as large as possible. However, the sculptor is bad in planning, so he asks you for help. 

There are n cities and m one-way roads in Berland. You have to choose four different cities, which Cicasso will visit and also determine the order in which he will visit them. So that the total distance he will travel, if he visits cities in your order, starting from the first city in your list, and ending in the last, choosing each time the shortest route between a pair of cities — will be the largest. 

Note that intermediate routes may pass through the cities, which are assigned to the tour, as well as pass twice through the same city. For example, the tour can look like that: <image>. Four cities in the order of visiting marked as overlines: [1, 5, 2, 4].

Note that Berland is a high-tech country. So using nanotechnologies all roads were altered so that they have the same length. For the same reason moving using regular cars is not very popular in the country, and it can happen that there are such pairs of cities, one of which generally can not be reached by car from the other one. However, Cicasso is very conservative and cannot travel without the car. Choose cities so that the sculptor can make the tour using only the automobile. It is guaranteed that it is always possible to do. 

Input

In the first line there is a pair of integers n and m (4 ≤ n ≤ 3000, 3 ≤ m ≤ 5000) — a number of cities and one-way roads in Berland.

Each of the next m lines contains a pair of integers ui, vi (1 ≤ ui, vi ≤ n) — a one-way road from the city ui to the city vi. Note that ui and vi are not required to be distinct. Moreover, it can be several one-way roads between the same pair of cities. 

Output

Print four integers — numbers of cities which Cicasso will visit according to optimal choice of the route. Numbers of cities should be printed in the order that Cicasso will visit them. If there are multiple solutions, print any of them.

Example

Input

8 9
1 2
2 3
3 4
4 1
4 5
5 6
6 7
7 8
8 5


Output

2 1 8 7

Note

Let d(x, y) be the shortest distance between cities x and y. Then in the example d(2, 1) = 3, d(1, 8) = 7, d(8, 7) = 3. The total distance equals 13. 

Solution (in JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collection;
import java.util.Set;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.stream.Collectors;
import java.util.HashSet;
import java.util.stream.Stream;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.util.Queue;
import java.util.LinkedList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyBufferedReader in = new MyBufferedReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        private int n;
        private int m;

        public void solve(int testNumber, MyBufferedReader in, PrintWriter out) {
            int[] data = in.getALineOfInts(2);
            n = data[0];
            m = data[1];

            Set<TaskD.HashEdge> set = new HashSet<>();

            GraphUtils.GraphNode[] nodes = new GraphUtils.GraphNode[n];
            GraphUtils.GraphNode[] reversed = new GraphUtils.GraphNode[n];
            for (int i = 0; i < n; i++) {
                nodes[i] = new GraphUtils.GraphNode(new GraphUtils.IdState(i));
                reversed[i] = new GraphUtils.GraphNode(new GraphUtils.IdState(i));
            }

            for (int i = 0; i < m; i++) {
                data = in.getALineOfInts(2);
                TaskD.HashEdge ne = new TaskD.HashEdge(data[0] - 1, data[1] - 1);
                if (!set.contains(ne) && data[0] != data[1]) {
                    nodes[data[0] - 1].transitions.add(new GraphUtils.Edge(nodes[data[1] - 1]));
                    reversed[data[1] - 1].transitions.add(new GraphUtils.Edge(reversed[data[0] -
                            1]));
                }
                set.add(ne);
            }

            int[][] topThreeFrom = new int[n][3];
            int[][] topThreeTo = new int[n][3];


            int[][] minDist;
            int[][] minDistRev;
            minDist = new int[n][n];
            for (int[] a : minDist) {
                Arrays.fill(a, -1);
            }

            minDistRev = new int[n][n];
            for (int[] a : minDistRev) {
                Arrays.fill(a, -1);
            }

            for (int[] a : topThreeFrom) {
                Arrays.fill(a, -1);
            }

            for (int[] a : topThreeTo) {
                Arrays.fill(a, -1);
            }

            for (int i = 0; i < n; i++) {
                bfs(i, nodes, topThreeFrom, minDist);
                bfs(i, reversed, topThreeTo, minDistRev);
            }

            int max = Integer.MIN_VALUE;
            int[] best = null;
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    if (i != j && minDist[i][j] != -1) {
                        for (int k = 0; k < 3; k++) {
                            for (int l = 0; l < 3; l++) {
                                if (topThreeFrom[j][k] != -1 && topThreeTo[i][l] != -1) {
                                    if (topThreeFrom[j][k] != topThreeTo[i][l] && topThreeFrom[j][k]
                                            != i &&

                                            topThreeTo[i][l] != j) {
                                        int candMax = minDistRev[i][topThreeTo[i][l]] +
                                                minDist[i][j] +
                                                minDist[j][topThreeFrom[j][k]];
                                        if (candMax > max) {
                                            max = candMax;
                                            best = new int[]{topThreeTo[i][l], i, j,
                                                    topThreeFrom[j][k]};
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            for (int i : best) {
                out.print((i + 1) + " ");
            }

        }

        private void bfs(int source, GraphUtils.GraphNode[] nodes, int[][] topThree, int[][]
                minDist) {
            Queue<GraphUtils.GraphNode> toExplore = new LinkedList<>();
            minDist[source][source] = 0;
            toExplore.add(nodes[source]);
            while (!toExplore.isEmpty()) {
                GraphUtils.GraphNode next = toExplore.remove();
                int id = ((GraphUtils.IdState) next.s).id;

                if (id != source) {
                    if (topThree[source][0] == -1 || minDist[source][topThree[source][0]] <
                            minDist[source][id]) {
                        topThree[source][0] = id;
                        sort(topThree[source], source, minDist);
                    }
                }

                for (GraphUtils.Edge childEdge : next.transitions) {
                    GraphUtils.GraphNode neighbour = childEdge.neighbour;
                    int nid = ((GraphUtils.IdState) neighbour.s).id;
                    if (minDist[source][nid] == -1) {
                        minDist[source][nid] = minDist[source][id] + 1;
                        toExplore.add(neighbour);
                    }
                }
            }
        }

        void sort(int[] a, int source, int[][] minDist) {
            if (a[1] == -1 || minDist[source][a[1]] < minDist[source][a[0]]) {
                MyArrays.swap(a, 0, 1);
            }

            if (a[2] == -1 || minDist[source][a[2]] < minDist[source][a[1]]) {
                MyArrays.swap(a, 1, 2);
            }
        }

        static class HashEdge {
            int src;
            int dest;

            public HashEdge(int src, int dest) {
                this.src = src;
                this.dest = dest;
            }


            public boolean equals(Object o) {
                if (this == o) return true;
                if (o == null || getClass() != o.getClass()) return false;

                TaskD.HashEdge hashEdge = (TaskD.HashEdge) o;

                if (src != hashEdge.src) return false;
                return dest == hashEdge.dest;
            }


            public int hashCode() {
                int result = src;
                result = 31 * result + dest;
                return result;
            }

        }

    }

    static class GraphUtils {
        public static class Edge {
            public GraphUtils.GraphNode neighbour;
            private boolean isParentEdge;

            public Edge(GraphUtils.GraphNode neighbour) {
                this.neighbour = neighbour;
                this.isParentEdge = false;
            }

            public Edge(GraphUtils.GraphNode neighbour, boolean isParentEdge) {
                this.neighbour = neighbour;
                this.isParentEdge = isParentEdge;
            }


            public boolean equals(Object o) {
                return o instanceof GraphUtils.Edge && ((GraphUtils.Edge) o).neighbour.equals
                        (neighbour) && isParentEdge ==
                        ((GraphUtils.Edge) o).isParentEdge;
            }


            public int hashCode() {
                return neighbour.hashCode() + (isParentEdge ? 1 : 0);
            }

        }

        public static class GraphNode {
            public GraphUtils.State s;
            public Set<GraphUtils.Edge> transitions;

            public GraphNode(GraphUtils.State s) {
                this.s = s;
                transitions = new HashSet<GraphUtils.Edge>();
            }

            public String toString() {
                return "(" + s.toString() + " : " + transitions.stream().map(t -> t.neighbour.s
                        .toString()).collect(Collectors.joining(", ")) + ")";
            }

        }

        public interface State {
        }

        public static class IdState implements GraphUtils.State {
            public int id;

            public IdState(int i) {
                id = i;
            }

            public String toString() {
                return Integer.toString(id);
            }

        }

    }

    static class MyArrays {
        public static void swap(int[] a, int pos1, int pos2) {
            int temp = a[pos1];
            a[pos1] = a[pos2];
            a[pos2] = temp;
        }

    }

    static class MyBufferedReader {
        BufferedReader in;

        public MyBufferedReader(InputStream s) {
            this.in = new BufferedReader(new InputStreamReader(s));
        }

        public int[] getALineOfInts(int numExpected) {
            int[] res = new int[numExpected];
            StringTokenizer st = null;
            try {
                st = new StringTokenizer(in.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
            for (int i = 0; i < numExpected; i++)
                res[i] = Integer.parseInt(st.nextToken());
            return res;
        }

    }
}