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;
struct outFloat {
  int precision;
  long double value;
  outFloat(long double v, int p) : precision(p), value(v) {}
};
template <typename T>
struct debugInfo {
  string name;
  T val;
  debugInfo(const char* n, T v) : name(n), val(v){};
};
template <typename T>
debugInfo<T> makeDebugInfo(const char* n, T v) {
  return debugInfo<T>(n, v);
}
const int inf = 123456789;
const long long llInf = 123456789012345678LL;
const long double pi = 3.14159265358979323846;
const int maxN = 5000;
int init() {
  ios_base::sync_with_stdio(0);
  srand(time(NULL));
  return 0;
}
int initializer = init();
template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& p) {
  is >> p.first >> p.second;
  return is;
}
template <typename T>
istream& operator>>(istream& is, vector<T>& p) {
  for (int i = 0; i < p.size(); i++) is >> p[i];
  return is;
}
class inputer {
 private:
  istream* istr;

 public:
  inputer(istream& is) : istr(&is) {}
  template <typename T>
  void get(T& n) {
    (*istr) >> n;
  }
  template <typename T, typename... Args>
  void get(T& n, Args&... args) {
    get(n);
    get(args...);
  }
  template <typename... Args>
  void getLn(Args&... args) {
    get(args...);
    getLn();
  }
  template <typename T>
  operator T() {
    T n;
    get(n);
    return n;
  }
  void getLn() {
    string s;
    getline(cin, s);
  }
  template <typename T>
  void getv(vector<T>& v, int size) {
    v.resize(size);
    (*istr) >> v;
  }
};
string delim = " ";
template <typename T1, typename T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& p) {
  os << p.first << delim << p.second;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& p) {
  for (int i = 0; i < p.size(); i++) {
    if (i != 0) os << delim;
    os << p[i];
  }
  return os;
}
ostream& operator<<(ostream& os, const outFloat& of) {
  os << setprecision(of.precision) << of.value;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const debugInfo<T>& dbg) {
  os << "\"" << dbg.name << "\" = \"" << dbg.val << "\""
     << "\n";
}
class outputer {
 private:
  ostream* ostr;

 public:
  outputer(ostream& os) : ostr(&os) {}
  template <typename T>
  void put(const T& n) {
    (*ostr) << n;
  }
  template <typename T, typename... Args>
  void put(const T& n, const Args&... args) {
    put(n);
    put(args...);
  }
  template <typename... Args>
  void putLn(const Args&... args) {
    put(args...);
    putLn();
  }
  template <typename T>
  outputer& operator=(const T& n) {
    putLn(n);
    return *this;
  }
  void putLn() { (*ostr) << "\n"; }
  template <typename T>
  void putv(vector<T> v, int size, string delim) {
    for (int i = 0; i < size; i++) {
      if (i != 0) (*ostr) << delim;
      (*ostr) << v[i];
    }
  }
};
inputer in(cin);
outputer out(cout);
char getChar() {
  char c = 0;
  while (c <= ' ') cin >> c;
  return c;
}
bool willItBeAC() {
  return true;
  ;
}
int getMyRating() { return 2048; }
bool prime(long long n) {
  for (long long i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
vector<long long> divs(long long n) {
  vector<long long> v;
  long long i = 2;
  while (i * i <= n)
    if (n % i == 0) {
      n /= i;
      v.push_back(i);
    } else
      i++;
  v.push_back(n);
  return v;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long extGcd(long long a, long long b, long long& x, long long& y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long x1, y1, d = extGcd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
template <typename T>
class fenwick {
 private:
  vector<T> t;
  int n;

 public:
  fenwick(int nn) { init(nn); }
  void init(int nn) {
    n = nn;
    t.assign(n, 0);
  }
  T sum(int r) {
    T result = 0;
    for (; r >= 0; r = (r & (r + 1)) - 1) result += t[r];
    return result;
  }
  void inc(int i, T delta) {
    for (; i < n; i = (i | (i + 1))) t[i] += delta;
  }
  T sum(int l, int r) { return sum(r) - sum(l - 1); }
  T get(int i) { return sum(i, i); }
  void put(int i, T v) { inc(i, v - sum(i, i)); }
  int size() { return n; }
};
int n = in, m = in;
vector<vector<int> > g(n);
vector<vector<int> > dist(n);
vector<vector<pair<int, int> > > rDist(n);
vector<vector<pair<int, int> > > qDist(n);
vector<int> ans(4);
int ansVal = 0;
inline void updAns(int a, int b, int c, int d) {
  if (dist[a][b] < 0 || dist[b][c] < 0 || dist[c][d] < 0) return;
  if (a == b || a == c || a == d || b == c || b == d || c == d) return;
  int nVal = dist[a][b] + dist[b][c] + dist[c][d];
  if (nVal > ansVal) ansVal = nVal, ans = {a + 1, b + 1, c + 1, d + 1};
}
vector<int> bfs(int v) {
  vector<int> d(n, inf);
  queue<int> q;
  d[v] = 0;
  q.push(v);
  while (!q.empty()) {
    int cur = q.front();
    q.pop();
    for (int i = 0; i < g[cur].size(); i++) {
      int to = g[cur][i];
      if (d[to] == inf) {
        d[to] = d[cur] + 1;
        q.push(to);
      }
    }
  }
  for (int i = 0; i < n; i++)
    if (d[i] == inf) d[i] = -1;
  return d;
}
int main() {
  for (int i = 0; i < m; i++) {
    int a = int(in) - 1, b = int(in) - 1;
    g[a].push_back(b);
  }
  for (int i = 0; i < n; i++) dist[i] = bfs(i);
  for (int i = 0; i < n; i++) rDist[i].resize(n), qDist[i].resize(n);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      rDist[i][j] = {dist[j][i], j}, qDist[i][j] = {dist[i][j], j};
  for (int i = 0; i < n; i++)
    sort(rDist[i].begin(), rDist[i].end()),
        sort(qDist[i].begin(), qDist[i].end());
  for (int b = 0; b < n; b++)
    for (int c = 0; c < n; c++) {
      if (dist[b][c] < 0 || b == c) continue;
      int pR = n - 1, pQ = n - 1;
      while (pQ >= 0 && (qDist[c][pQ].second == b || qDist[c][pQ].second == c))
        pQ--;
      while (pR >= 0 && (rDist[b][pR].second == b || rDist[b][pR].second == c))
        pR--;
      for (int i = max(0, pR - 3); i <= pR; i++)
        for (int j = max(0, pQ - 3); j <= pQ; j++) {
          int a = rDist[b][i].second, d = qDist[c][j].second;
          updAns(a, b, c, d);
        }
    }
  out = ans;
  return 0;
}