#include <bits/stdc++.h>
using namespace std;

void solve(){
	int n; double x;
	cin >> n >> x;
	double am = 0, duong = 0;
	int begin = 0, end = 0;
	for (int i = 1; i <=n ; i++ ){
		double a;
		cin >> a;
		if (a < 0) {
			if (am == 0) am = a;
		}
		else duong = a;
		if (a == x ) {
			if (begin == 0) begin = i;
			end = i;
		}

	}
	
	cout << fixed << setprecision(2) << am << ' ' << duong << endl;
	cout << begin << ' ' << end;
}
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);    cout.tie(0);
	solve();
	return 0;
}
