#include<iostream>
#include<deque>
using namespace std;
const int N=2e6;
deque<int>st;
int n,k,m,a[N];
int main()
{
cin>>n;
for (int i = 1 ; i <= n ; i ++)
{
cin >> a[i];
}
for ( int i = 1 ; i <= n ; i ++)
{
if(!st.empty() && a[i]>=st.back())
{
st.pop_back() ;
}
st.push_back(i);
if( st.front() <= (i-k))
{
st.pop_front() ;
}
if( i >= k)
{
cout << st.front() << endl;
}
}
return 0;
}