#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <vector>
#include <climits>
using namespace std;

long long mod = 1000000007;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, x;cin >> n >> x;
    vector<int> v;
    for (int i = 0;i < n;i++) {
        int value;cin >> value;
        v.push_back(value);
    }

    // 
    auto itOne = lower_bound(v.begin(), v.end(), x);
    if (itOne != v.end()) {
        cout << distance(v.begin(), itOne) << endl;
    }
    else {
        cout << -1 << endl;
    }

    // 
    auto itTwo = upper_bound(v.begin(), v.end(), x);
    if (itTwo != v.end()) {
        cout << distance(v.begin(), itTwo) << endl;
    }
    else {
        cout << -1 << endl;
    }

    // 
    auto itThree = lower_bound(v.begin(), v.end(), x);
    if (*itThree == x) {
        cout << distance(v.begin(), itThree) << endl;
    }
    else {
        cout << -1 << endl;
    }

    //
    auto itFour = upper_bound(v.begin(), v.end(), x);
    itFour--;
    if (*itFour == x) {
        cout << distance(v.begin(), itFour) << endl;
    }
    else {
        cout << -1 << endl;
    }

    cout << distance(itThree, itFour) + 1;
    return 0;
};

