#include <iostream>
#include <set>
#include <vector>
#include <map>
#include <climits>
#include <algorithm>
using namespace std;

int main() {

    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;
}