#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <iterator>
#include <functional>
#include <complex>
#include <queue>
#include <stack>
#include <cmath>
#include <cassert>
#include <tuple>
using namespace std;
typedef long long LL;
typedef complex<double> CMP;

struct Rat {
	LL s, b;  // s/b

	Rat(LL s, LL b) : s(s), b(b) {}

	// take abs() too
	Rat operator-(const Rat& rhs) {
		LL a = s, c = rhs.s, d = rhs.b;
		return Rat(abs(a*d - b*c), b*d);
	}

	bool operator<(const Rat& rhs) {
		unsigned long long a = s, c = rhs.s, d = rhs.b;
		return a*d < b*c;
	}
};

class MinimizeAbsoluteDifferenceDiv1 { public:
	vector <int> findTuple(vector <int> x)
	{
		vector<int> idx = { 0,1,2,3,4 };
		vector<int> best;
		Rat bestval(0, 0);
		do {
			Rat val = Rat(x[idx[0]], x[idx[1]]) - Rat(x[idx[2]], x[idx[3]]);
			if (best.empty() || val < bestval)
				best = idx, bestval = val;
		} while (next_permutation(idx.begin(), idx.end()));

		best.resize(4);
		return best;
	}
};

// BEGIN CUT HERE
#include <ctime>
double start_time; string timer()
 { ostringstream os; os << " (" << int((clock()-start_time)/CLOCKS_PER_SEC*1000) << " msec)"; return os.str(); }
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v)
 { os << "{ ";
   for(typename vector<T>::const_iterator it=v.begin(); it!=v.end(); ++it)
   os << '\"' << *it << '\"' << (it+1==v.end() ? "" : ", "); os << " }"; return os; }
void verify_case(const vector <int>& Expected, const vector <int>& Received) {
 bool ok = (Expected == Received);
 if(ok) cerr << "PASSED" << timer() << endl;  else { cerr << "FAILED" << timer() << endl;
 cerr << "\to: " << Expected << endl << "\tx: " << Received << endl; } }
#define CASE(N) {cerr << "Test Case #" << N << "..." << flush; start_time=clock();
#define END	 verify_case(_, MinimizeAbsoluteDifferenceDiv1().findTuple(x));}
int main(){

CASE(0)
	int x_[] = {1,1,1,1,1};
	  vector <int> x(x_, x_+sizeof(x_)/sizeof(*x_)); 
	int __[] = {0, 1, 2, 3 };
	  vector <int> _(__, __+sizeof(__)/sizeof(*__)); 
END
CASE(1)
	int x_[] = {2,3,5,7,11};
	  vector <int> x(x_, x_+sizeof(x_)/sizeof(*x_)); 
	int __[] = {0, 3, 1, 4 };
	  vector <int> _(__, __+sizeof(__)/sizeof(*__)); 
END
CASE(2)
	int x_[] = {8, 2, 4, 2, 6};
	  vector <int> x(x_, x_+sizeof(x_)/sizeof(*x_)); 
	int __[] = {1, 0, 3, 4 };
	  vector <int> _(__, __+sizeof(__)/sizeof(*__)); 
END
CASE(3)
	int x_[] = {124, 182, 9, 33, 70};
	  vector <int> x(x_, x_+sizeof(x_)/sizeof(*x_)); 
	int __[] = {2, 4, 3, 1 };
	  vector <int> _(__, __+sizeof(__)/sizeof(*__)); 
END
CASE(4)
	int x_[] = {9947, 3, 7, 11, 13};
	  vector <int> x(x_, x_+sizeof(x_)/sizeof(*x_)); 
	int __[] = {1, 4, 3, 0 };
	  vector <int> _(__, __+sizeof(__)/sizeof(*__)); 
END
CASE(5)
	int x_[] = {10000, 4, 10, 4, 10};
	  vector <int> x(x_, x_+sizeof(x_)/sizeof(*x_)); 
	int __[] = {1, 2, 3, 4 };
	  vector <int> _(__, __+sizeof(__)/sizeof(*__)); 
END
/*
CASE(6)
	int x_[] = ;
	  vector <int> x(x_, x_+sizeof(x_)/sizeof(*x_)); 
	int __[] = ;
	  vector <int> _(__, __+sizeof(__)/sizeof(*__)); 
END
CASE(7)
	int x_[] = ;
	  vector <int> x(x_, x_+sizeof(x_)/sizeof(*x_)); 
	int __[] = ;
	  vector <int> _(__, __+sizeof(__)/sizeof(*__)); 
END
*/
}
// END CUT HERE
