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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void Read(T &x) {
  int f = 1;
  char t = getchar();
  while (t < '0' || t > '9') {
    if (t == '-') f = -1;
    t = getchar();
  }
  x = 0;
  while (t >= '0' && t <= '9') {
    x = x * 10 + t - '0';
    t = getchar();
  }
  x *= f;
}
template <typename T>
inline void Write(T x) {
  static int output[20];
  int top = 0;
  if (x < 0) putchar('-'), x = -x;
  do {
    output[++top] = x % 10;
    x /= 10;
  } while (x > 0);
  while (top > 0) putchar('0' + output[top--]);
  putchar('\n');
}
template <typename T>
inline void chkmin(T &x, T y) {
  if (x > y) x = y;
}
template <typename T>
inline void chkmax(T &x, T y) {
  if (x < y) x = y;
}
const int maxn = 5005;
const int inf = 0x3f3f3f3f;
int n;
int m;
int fst[maxn];
int v[maxn], nxt[maxn];
int e_cn;
int dis[maxn][maxn];
pair<int, int> in[maxn][5];
pair<int, int> out[maxn][5];
void addedge(int x, int y) {
  e_cn++, v[e_cn] = y;
  nxt[e_cn] = fst[x], fst[x] = e_cn;
}
void input() {
  Read(n);
  Read(m);
  for (int i = 1; i <= m; i++) {
    int x, y;
    Read(x);
    Read(y);
    addedge(x, y);
  }
}
void prepare() {
  static queue<int> q;
  static bool vis[maxn];
  memset(dis, inf, sizeof(dis));
  for (int i = 1; i <= n; i++) {
    int *d = dis[i];
    d[i] = 0;
    vis[i] = true;
    q.push(i);
    while (!q.empty()) {
      int cn = q.front();
      q.pop();
      vis[cn] = false;
      for (int i = fst[cn]; i; i = nxt[i]) {
        if (d[v[i]] > d[cn] + 1) {
          d[v[i]] = d[cn] + 1;
          if (!vis[v[i]]) {
            vis[v[i]] = true;
            q.push(v[i]);
          }
        }
      }
    }
  }
  static int stamp[maxn];
  for (int i = 1; i <= n; i++) {
    static int counter;
    counter++;
    for (int k = 1; k <= 4; k++) {
      pair<int, int> mx = make_pair(-inf, 0);
      for (int j = 1; j <= n; j++) {
        if (stamp[j] == counter || dis[j][i] == inf || j == i) continue;
        chkmax(mx, make_pair(dis[j][i], j));
      }
      in[i][k] = mx;
      stamp[mx.second] = counter;
    }
    counter++;
    for (int k = 1; k <= 4; k++) {
      pair<int, int> mx = make_pair(-inf, 0);
      for (int j = 1; j <= n; j++) {
        if (stamp[j] == counter || dis[i][j] == inf || j == i) continue;
        chkmax(mx, make_pair(dis[i][j], j));
      }
      out[i][k] = mx;
      stamp[mx.second] = counter;
    }
  }
}
void solve() {
  static bool vis[maxn];
  int ans = 0;
  int a, b, c, d;
  for (int i = 1; i <= n; i++) {
    vis[i] = true;
    for (int j = 1; j <= n; j++) {
      if (i != j && dis[i][j] < inf) {
        vis[j] = true;
        for (int k = 1; k <= 4; k++) {
          if (!vis[in[i][k].second]) {
            int fr = in[i][k].second;
            vis[fr] = true;
            for (int p = 1; p <= 4; p++) {
              if (!vis[out[j][p].second]) {
                int to = out[j][p].second;
                vis[to] = true;
                if (dis[fr][i] < inf && dis[j][to] < inf) {
                  if (dis[fr][i] + dis[i][j] + dis[j][to] > ans) {
                    ans = dis[fr][i] + dis[i][j] + dis[j][to];
                    a = fr, b = i, c = j, d = to;
                  }
                }
                vis[to] = false;
                break;
              }
            }
            vis[fr] = false;
            break;
          }
        }
        for (int k = 1; k <= 4; k++) {
          if (!vis[out[j][k].second]) {
            int to = out[j][k].second;
            vis[to] = true;
            for (int p = 1; p <= 4; p++) {
              if (!vis[in[i][p].second]) {
                int fr = in[i][p].second;
                vis[fr] = true;
                if (dis[fr][i] < inf && dis[j][to] < inf) {
                  if (dis[fr][i] + dis[i][j] + dis[j][to] > ans) {
                    ans = dis[fr][i] + dis[i][j] + dis[j][to];
                    a = fr, b = i, c = j, d = to;
                  }
                }
                vis[fr] = false;
                break;
              }
            }
            vis[to] = false;
            break;
          }
        }
        vis[j] = false;
      }
    }
    vis[i] = false;
  }
  printf("%d %d %d %d\n", a, b, c, d);
}
int main() {
  input();
  prepare();
  solve();
  return 0;
}