#include<bits/stdc++.h>
using namespace std;
int main(){
int n,i,t,c[10005],a,b,x=0,k=0;
cin>>n>>t;
for(i=0;i<n;i++)
{cin>>c[i];
if(c[i]>x)x=c[i];
}
for(i=0;i<n;i++){
if(c[i]>t&&c[i-1]<=t)a=i;
if(c[i]>t&&c[i+1]<=t){
b=i;
cout<<"["<<a<<", "<<b<<"]\n";
a=0,b=0;
k=1;
}
}
if(k==0)cout<<x;
return 0;
}