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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int n; cin >> n;
    vector<pair<int64_t, int>> v(n + 1);
    for (int i = 1; i <= n; i++) {
        cin >> v[i].first;
        v[i].second = i;
    }
    sort(v.begin() + 1, v.end());
    int k; cin >> k;

    int64_t cst = 0, sum = 0;
    for (int i = 1, j = 1; i <= k; i++, j += 2) {
        cst += (j - k) * v[i].first;
        sum += v[i].first;
    }

    pair<int64_t, int> ans(cst, k);
    for (int i = k + 1; i <= n; i++) {
        cst -= (1 - k) * v[i - k].first;
        sum -= v[i - k].first;
        cst -= 2 * sum;
        cst += (k - 1) * v[i].first;
        sum += v[i].first;
        ans = min(ans, make_pair(cst, i));
    }

    for (int i = k - 1; i >= 0; i--)
        cout << v[ans.second - i].second << ' ';
    cout << '\n';
    return 0;
}


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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int n; cin >> n;
    vector<int64_t> v(n + 1);
    for (int i = 1; i <= n; i++)
        cin >> v[i];
    int k; cin >> k;

    int64_t cst = 0, sum = 0;
    for (int i = 1, j = 1; i <= k; i++, j += 2) {
        cst += (j - k) * v[i];
        sum += v[i];
    }

    pair<int64_t, int> ans(cst, k);
    for (int i = k + 1; i <= n; i++) {
        cst -= (1 - k) * v[i - k];
        sum -= v[i - k];
        cst -= 2 * sum;
        cst += (k - 1) * v[i];
        sum += v[i];
        ans = min(ans, make_pair(cst, i));
    }

    for (int i = k - 1; i >= 0; i--)
        cout << ans.second - i << ' ';
    cout << '\n';
    return 0;
}


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

#define ll long long
#define mod 1000000007
#define ffor(i,a,b) for(int i=a;i<b;i++)
#define bfor(i,a,b) for(int i=a-1;i>=b;i--)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define mem(x,y) memset(x,y,sizeof(x))
#define all(x) x.begin(),x.end()
#define SP(x) setprecision(x)
#define sz(x) (int)x.size()
#define fast  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define PI 3.14159265358979323846
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define endl '\n'
#define int long long

signed main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    int n;
    cin>>n;
    vector<pair<int,int>> v;
    v.pb({0,0});
    ffor(i,1,n+1)
    {
        int x;
        cin>>x;
        v.pb({x,i});
    }
    int k;
    cin>>k;
    sort(all(v));

    int ans[n+1]={0};
    ll sum[n+1]={0};
    ffor(i,1,n+1) sum[i]=sum[i-1]+v[i].ff;
    ffor(i,2,n+1)
    {
        if(i+k-1>n) break;
        ll x=(k-1)*v[i+k-1].ff-(sum[i+k-2]-sum[i-1]);
      //  cout<<i<<" "<<x<<endl;
        x-= sum[i+k-2]-sum[i-1]-(k-1)*v[i-1].ff;
        ans[i]=ans[i-1]+x;
       // cout<<i<<" "<<ans[i]<<" "<<x<<endl;
    }
    int minn=0;
    int idx=1;
    ffor(i,1,n+1)
    {
        if(minn>ans[i])
        {
            minn=ans[i];
            idx=i;
        }
    }
    ffor(i,idx,idx+k) cout<<v[i].ss<<" ";
    return 0;
}


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

#define ll long long
#define mod 1000000007
#define ffor(i,a,b) for(int i=a;i<b;i++)
#define bfor(i,a,b) for(int i=a-1;i>=b;i--)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define mem(x,y) memset(x,y,sizeof(x))
#define all(x) x.begin(),x.end()
#define SP(x) setprecision(x)
#define sz(x) (int)x.size()
#define fast  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define PI 3.14159265358979323846
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define endl '\n'
#define int long long

signed main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    int n;
    cin>>n;
    vector<pair<int,int>> v;
    v.pb({0,0});
    ffor(i,1,n+1)
    {
        int x;
        cin>>x;
        v.pb({x,i});
    }
    int k;
    cin>>k;
    sort(all(v));

    int ans[n+1]={0};
    ll sum[n+1]={0};
    ffor(i,1,n+1) sum[i]=sum[i-1]+v[i].ff;
    ffor(i,2,n+1)
    {
        if(i+k-1>n) break;
        ll x=(k-1)*v[i+k-1].ff-(sum[i+k-2]-sum[i-1]);
        x-= sum[i+k-2]-sum[i-1]-v[i-1].ff;
        ans[i]=ans[i-1]+x;

    }
    int minn=0;
    int idx=1;
    ffor(i,1,n+1)
    {
        if(minn>ans[i])
        {
            minn=ans[i];
            idx=i;
        }
    }
    ffor(i,idx,idx+k) cout<<v[i].ss<<" ";
    return 0;
}


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

#define ll long long
#define mod 1000000007
#define ffor(i,a,b) for(int i=a;i<b;i++)
#define bfor(i,a,b) for(int i=a-1;i>=b;i--)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define mem(x,y) memset(x,y,sizeof(x))
#define all(x) x.begin(),x.end()
#define SP(x) setprecision(x)
#define sz(x) (int)x.size()
#define fast  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define PI 3.14159265358979323846
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define endl '\n'
#define int long long

signed main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    int n;
    cin>>n;
    vector<pair<int,int>> v;
    v.pb({0,0});
    ffor(i,1,n+1)
    {
        int x;
        cin>>x;
        v.pb({x,i});
    }
    int k;
    cin>>k;
    sort(++v.begin(),v.end());

    int ans[n+1]={0};
    ll sum[n+1]={0};
    ffor(i,1,n+1) sum[i]=sum[i-1]+v[i].ff;
    ffor(i,2,n+1)
    {
        if(i+k-1>n) break;
        ll x=(k-1)*v[i+k-1].ff-(sum[i+k-2]-sum[i-1]);
      //  cout<<i<<" "<<x<<endl;
        x-= sum[i+k-2]-sum[i-1]-(k-1)*v[i-1].ff;
        ans[i]=ans[i-1]+x;
      //  cout<<i<<" "<<ans[i]<<" "<<x<<endl;
    }
    int minn=0;
    int idx=1;
    ffor(i,1,n+1)
    {
        if(minn>ans[i])
        {
            minn=ans[i];
            idx=i;
        }
    }
    ffor(i,idx,idx+k) cout<<v[i].ss<<" ";
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define all(x) (x).begin(), (x).end()

using namespace __gnu_pbds;
using namespace std;

using ull = unsigned long long;
using ll = long long;
using ld = long double;
template <typename T> using ordered_set = tree<T, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update>;

const int mod = 1e9 + 7;
const int inf = INT_MAX;
const int N = 3e5 + 5;

int n, k;
pair<int, int> a[N];
ll pref[N];

ll sum(int l, int r) {
    return pref[r] - pref[l - 1];
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i].first, a[i].second = i;
    cin >> k;

    sort(a + 1, a + n + 1);
    for (int i = 1; i <= n; i++) {
        pref[i] = pref[i - 1] + a[i].first;
    }

    int best = 1;
    ll cur = 0, best_val = 0;

    for (int i = 1; i < k; i++) {
        cur += sum(i + 1, k) - (k - i) * (ll)a[i].first;
    }

    best_val = cur;
    for (int i = 2; i + k <= n + 1; i++) {
        cur -= sum(i, i + k - 2) - (k - 1) * (ll)a[i - 1].first;
        cur += (k - 1) * (ll)a[i + k - 1].first - sum(i, i + k - 2);
        if (cur < best_val) {
            best = i;
            best_val = cur;
        }
    }

    for (int i = best; i <= best + k - 1; i++) cout << a[i].second << " ";
    cout << '\n';
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define fast { ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0); }
#define pb push_back
#define ll long long
#define ld long double

#define vi vector<int>
#define vl vector<long>
#define vll vector<long long>

#define infi INT_MAX
#define infl LONG_LONG_MAX
#define infd LDBL_MAX
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fi(i,a,b) for(ll i=(b-1);i>=a;i--)
#define F first
#define S second
#define G(a,b) get<a>(b)
#define MP make_pair
#define MT make_tuple
#define pll pair<ll,ll>
#define endl "\n"
#define ALL(v) v.begin(),v.end()
#define nl cout<<"\n";
#define pr(x) cout<<x;
#define pr1(x) cout<<x<<" ";
#define pr2(x,y) cout<<x<<" "<<y;
#define deb printf("***************************************************************************************\n");
#define moshi printf("moshi moshi ! \n");
#define hi printf("hi ! \n");
#define bye printf("bye bye ! \n");
#define o_set(ll) tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define number_of_set_bits  __builtin_popcountll
const ld PI=3.1415926535897932384626433;

//template<typename T>
//#define o_set(T) tree<T, null_type,less<T>, rb_tree_tag,tree_order_statistics_node_update>
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set

//const ll N=1e6+7;
ll p=1e9+7;
//ll fac[N];

ll gcd(ll a, ll b)
{
   if (a == 0) return b;
   return gcd(b % a, a);
}

inline ll ceil(ll a,ll b)
{
   return (a+b-1)/b;
}

ll max(ll x,ll y,ll z)
{
   return max(x,max(y,z));
}

ll min(ll x,ll y,ll z)
{
   return min(x,min(y,z));
}

ll modpro(ll x,ll y,ll z=1)
{
   x%=p;
   y%=p;
   z%=p;
   ll res=(x*y)%p;
   res=(res*z)%p;
   return res;
}

ll modadd(ll x,ll y,ll z=0)
{
   x%=p;
   y%=p;
   z%=p;
   ll res=(x+y)%p;
   res=(res+z)%p;
   return res;
}

ll pow_mod_p(ll a,ll b)
{
   a=a%p;
   ll res=1;
   while(b>0)
   {
     if(b&1) res=(res*a)%p;
     b=b>>1;
     a=(a*a)%p;
   }
   return res;
}

inline ll mod_inv(ll x)
{
   return pow_mod_p(x,p-2);
}

// Don't forget to set fac[0]=1
/*ll nCr(ll x,ll y)
{
   if(x<y) return 0;
   ll res=fac[x];
   ll den=(fac[y]*fac[x-y])%p;
   ll deni=mod_inv(den);
   res=(res*deni)%p;
   return res;
}*/

ll is_set(ll a,ll i)
{
   if( ( a & ((ll)1<<i) ) == 0 ) return 0;
   else return 1;
}

//  Comparator should follow :
//  1: x<=y or y<=x uniquely
//  2: Transitivity : a<=b and b<=c implies a<=c
//  3: Anti-Symmetry: a<=b and b<=a implies a=b
// return 1 to put x before y in sorted order
/*inline bool comp(pll &x,pll &y)
{
   if(x.F<y.F) return 1;
   else if(x.F==y.F)
   {
      if(x.S>y.S) return 1;
      else return 0;
   }
   return 0;
}*/

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

// resize : str.resize(new_size)   new size <= old size

// for Vector :
// lower_bound(starting iterator , iterator next to end , value)  :  iterator to first element greater than or equal to value
// upper_bound(starting iterator , iterator next to end , value)  :  iterator to first element strictly greater than value

// For Set :      s.lower_bound(value)
// if no such element exists they return  vector.end() or s.end()

// x bits : [x-1 , x-2 , .... , 1(1st bit) , 0(0th bit)] =>   leftmost 1 at 2^(x-1)    max number that can be represented : 2^(x) -1
// 63 bits is greater than 10^18

// 1<<x  :  2 ^ x  (left shift)

// Min heap :  priority_queue < ll , vector<ll>, greater<ll> > q
// Max heap :  priority_queue < ll > q
    // Set in descending order  :   set< ll,greater <ll> >

// While debugging :
// 1 : check if array size is correct  :  It may give unexpected results
// 2 : check if you have swapped i and j at some part of program
// 3 : for string check if you are trying to acces  index = -1

// Bitwise Tricks :
// 1 : While using 1<<i  use (ll)1<<i  because in former one "1" is considered as int
// 2 : To flip first k-bits of a number :  x xor (2^k-1)  or x ^ (((ll)1<<k)-1)  : 2^k-1 is the largest number of k bits
// 3 : To flip k-th bit (0-based)  :  x xor (2^k)  or  x ^ ((ll)1<<k)
// 4 : To set k-th bit (0-based)   :  x or (2^k)   or  x | ((ll)1<<k)
// 5 : To un-set k-th bit (0-based)   :  x & (~ ((ll)1<<k) )

// To prove Greedy :
// 1 : Optimal Choice at each step
// 2 : Exchange Argument
// 3 : Find a lower or upper bound on answer and then construct an answer for that bound
// 4 : Find properties which Optimal Solution must satisfy ( This can be useful to deduce form of Optimal answer)

// Erase one occurrence in multiset : it=s.find(element)   s.erase(it)
// putchar('a'+j) : to print (j+1)th character
// getline(cin,str) : To input string until newline

void lps(string &pp,ll *lps)
{
   ll xx=pp.length();
   //ll lps[xx]={};
   f(i,1,xx)
   {
       ll j=lps[i-1];
       while(j>0 && pp[j]!=pp[i]) j=lps[j-1];
       if(pp[i]==pp[j]) j++;
       lps[i]=j;
   }
}

// Remember to take input string as  getline(cin,s)
void stoi(string &s,vll &v)
{
   stringstream str(s);
   ll x;
   while(str>>x)
   {
       v.pb(x);
   }
}

void Miden(ll **p1,ll n)
{
    ll (*x)[n]=(ll(*)[n]) p1;
    f(i,0,n)
    {
        f(j,0,n)
        {
            x[i][j]=0;
        }
        x[i][i]=1;
    }
    return;
}

void Mmult(ll **p1,ll **p2,ll **ans,ll x,ll y,ll z,ll m)
{
    ll (*a)[y]=(ll (*)[y])p1;
    ll (*b)[z]=(ll (*)[z])p2;
    ll (*c)[z]=(ll (*)[z])ans;
    f(i,0,x)
    {
        f(j,0,z)
        {
            c[i][j]=0;
            f(k,0,y)
            {
                c[i][j]+=a[i][k]*b[k][j];
                c[i][j]%=m;
            }
        }
    }
    return;
}

void Mpow(ll **p1,ll **ans,ll n,ll y,ll m)
{
    if(y==0)
    {
        Miden(ans,n);
        return;
    }
    ll t[n][n];
    Mpow(p1,(ll **)t,n,y/2,m);
    ll z[n][n];
    Mmult((ll **)t,(ll **)t,(ll **)z,n,n,n,m);
    if(y%2)
    {
        Mmult((ll **)z,p1,ans,n,n,n,m);
    }
    else
    {
        Miden((ll **)t,n);
        Mmult((ll **)z,(ll **)t,ans,n,n,n,m);
    }
    return;
}

const ll N=3e5+5;
ll arr[N],dp[N],pre[N];

struct station
{
  ll x,idx;
};

vector<station>v;

inline bool comp(const station &sx,const station &sy)
{
  if(sx.x!=sy.x) return sx.x<sy.x;
  else return sx.idx<sy.idx;
}

void func()
{
  ll n,k;
  cin>>n;
  f(i,1,n+1)
  {
    cin>>arr[i];
    v.pb((station){arr[i],i});
  }
  cin>>k;

  sort(ALL(v),comp);

  f(i,1,n+1) pre[i]=pre[i-1]+v[i-1].x;  // 0 based indexing in vector

  f(i,1,k+1)
  {
    dp[i]+=((i-1)*(v[i-1].x)-pre[i-1])+dp[i-1];  // 0 based indexing for vector
  }

  ll ans=dp[k],pos=k;

  f(i,k+1,n+1)
  {
    dp[i]=dp[i-1]+(k-1)*(v[i-1].x+v[i-k-1].x)-2*(pre[i-1]-pre[i-k]);  // 0 based indexing for vector
    if(dp[i]<ans)
    {
      ans=dp[i];
      pos=i;
    }
  }

  f(i,pos-k,pos) pr1(v[i].idx)
  nl
}

int main()
{
    fast

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif // ONLINE_JUDGE

    ll ntc=1;
    //cin>>ntc;

    f(i,1,ntc+1)
    {
      //cout<<"Case #"<<i<<": ";
      func();
    }
    return 0;
}


#include <bits/stdc++.h>
/* Uncomment only if you are not using GNU compiler->
#include <map> #include <algorithm> #include <vector> #include <string.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <chrono> #include <thread> #include <iomanip>
*/
//define
#define rep(i,n)    for(int i=0;i<n;i++)
#define repu(i,k,n) for(int i=k;i<=n;i++)
#define repd(i,k,n) for(int i=k;i>=n;i--)
#define se second
#define fi first
#define pb push_back
#define mp make_pair
#define all(v)  v.begin(), v.end()

//typedef
typedef long long int ll;
typedef std::pair<int, int> pii;
typedef std::vector<int> vi;
typedef std::vector< pii > vii;
typedef std::vector< ll > vll;
typedef std::vector< std::pair < pii, int > > vpp;

const long long MOD = 1000000007;
const long long inf = 1e18;

using namespace std;

ll modpow(ll x,ll n){
    ll res=1;
    while(n>0){
        if(n&1) res=res*x%MOD;
        x=x*x%MOD;
        n>>=1;
    }
    return res;
}

int power(int x, int n)
{
    int res=1;
    while(n>0){
        if(n&1) res=res*x;
        x=x*x;
        n>>=1;
    }
    return res;
}

void solve()
{
    int n;
    cin>>n;
    vector<pair<ll, int>> v;
    int x, y;
    rep(i,n)
    {
        cin>>x;
        v.pb(mp(x,i+1));
    }
    int k;
    cin>>k;
    sort(all(v));
    vll dp(n,0);
    vll dp2(n,0);
    rep(i,k-1)
    {
        dp2[0]+=v[i].fi;
    }
    repu(i,1,n-1)
    {
        if(i+k-2>=n)
            break;
        dp2[i]=dp2[i-1]-v[i-1].fi+v[i+k-2].fi;
    }
    x=1-k;
    rep(i,k)
    {
        dp[0]+=x*v[i].fi;
        // cout<<x*v[i].fi<<" ";
        x+=2;
    }
    // cout<<endl;
    ll minimum=dp[0];
    y=0;
    repu(i,1,n)
    {
        if(i+k-1>=n)
            break;
        ll sum=0;
        sum=dp[i-1];
        sum+=(k-1)*v[i-1].fi;
        sum-=2*dp2[i];
        sum+=(k-1)*v[i+k-1].fi;
        dp[i]=sum;
        if(dp[i]<minimum)
        {
            y=i;
        }
        minimum=min(minimum,dp[i]);
    }
    vi vv;
    rep(i,k)
    {
        vv.pb(v[i+y].se);
    }
    sort(all(vv));
    rep(i,vv.size())
    {
        cout<<vv[i]<<" ";
    }
    cout<<endl;
}

int main() {
    #ifndef ONLINE_JUDGE
        // for getting input from input.txt
        freopen("input.txt", "r", stdin);
        // for writing output to output.txt
        freopen("ff.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    int t = 1, tt=1;
    // pre();
    // cin>>t;
    while(tt<=t)
    {
        // cout<<"Case #"<<tt<<": ";
        solve();
        tt++;
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}


#include<bits/stdc++.h>
using namespace std;
int i,i0,n,m,a[300005];
long long ans,sum,tmp;
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",&a[i]);
	sort(a+1,a+1+n);
	scanf("%d",&m);
    for(int i=1;i<=m;i++)
	{
		sum+=a[i];
		tmp+=(long long)i*a[i]-sum;
	}
	ans=tmp;
	int l=0;
	for(int i=m+1;i<=n;i++)
	{
		tmp-=sum-(long long)m*a[i-m];
		sum-=a[i-m];
		sum+=a[i];
		tmp+=(long long)m*a[i]-sum;
		if(ans>tmp)ans=tmp,l=i-m;
		ans=min(ans,tmp);
	}
	for(int i=1;i<=m;i++)printf("%d%c",l+i,i==m?'\n':' ');
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int i,i0,n,m;
pair<int,int>a[300005];
long long ans,sum,tmp;
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",&a[i].first),a[i].second=i;
	sort(a+1,a+1+n);
	scanf("%d",&m);
    for(int i=1;i<=m;i++)
	{
		sum+=a[i].first;
		tmp+=(long long)i*a[i].first-sum;
	}
	ans=tmp;
	int l=0;
	for(int i=m+1;i<=n;i++)
	{
		tmp-=sum-(long long)m*a[i-m].first;
		sum-=a[i-m].first;
		sum+=a[i].first;
		tmp+=(long long)m*a[i].first-sum;
		if(ans>tmp)ans=tmp,l=i-m;
		ans=min(ans,tmp);
	}
	for(int i=1;i<=m;i++)printf("%d%c",a[l+i].second,i==m?'\n':' ');
    return 0;
}


#include<bits/stdc++.h>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#define int long long
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

const int INF = 0x3f3f3f3f;
const int MAXN = 3e5 + 5;

int n,k,pos;
pii a[MAXN];
ll pre[MAXN];

signed main(){
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	scanf("%lld",&n);
	for(int i = 1;i <= n;i++){
		scanf("%lld",&a[i].first);
		a[i].second = i;
	}
	sort(a + 1,a + 1 + n);
	for(int i = 1;i <= n;i++)
		pre[i] = pre[i - 1] + a[i].first;
	scanf("%lld",&k);
	ll sum = 0,ans = LONG_LONG_MAX;
	for(int i = 1;i < k;i++)
		sum = sum + 1ll * a[i].first * i - pre[i - 1];
	for(int i = 1;i <= n - k + 1;i++){
		if(ans > sum){
			pos = i;
			ans = sum;
		}
		sum = sum - ((pre[i + k - 1] - pre[i]) - 1ll * a[i].first * (k - 1)) + (1ll * a[i + k].first * (k - 1) - (pre[i + k - 1] - pre[i]));
	}
	for(int i = pos;i <= pos + k - 1;i++)
		printf("%lld ",a[i].second);
	return 0;
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <set>
#include <list>
#include <queue>
#include <map>
using namespace std;
#define _CRT_SECURE_NO_WARNINGS
#define Abs                           \
	ios_base::sync_with_stdio(false); \
	cout.tie(NULL);                   \
	cin.tie(NULL);
#define FOR(i, b, a) for (ll i = b; i < a; i++)
#define FOR1(i, b, a) for (ll i = b; i <= a; i++)
#define FORd(i, b, a) for (int i = (a)-1; i >= b; i--)
const double PI = acos(-1);
#define all(v) ((v).begin()), ((v).end())
#define allr(v) ((v).rbegin()), ((v).rend())
#define iq(v)   v.resize(unique(v.begin(), v.end()) - v.begin())
#define endl "\n"
#define sz(v) ((ll)((v).size()))
#define fx(n)           fixed << setprecision(n)
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef pair<long long, long long> pii;
int main()
{
	Abs;
	ll n, k;
	cin >> n;
	vi v(n + 1), pre(n + 1);
	FOR1(i, 1, n)
	cin >> v[i];
	cin >> k;
	sort(all(v));
	FOR(i, 1, n)
	{
		pre[i] = pre[i - 1] + v[i];
	}
	ll l = 1, r = 2, st = 1, en = k, ans = 0, s = 0;
	while (r <= k)
	{
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		r++;
	}
	ans = s;
	while (r <= n)
	{
		s -= (pre[r - 1] - pre[l] - v[l] * (r - l - 1));
		l++;
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		if (ans > s)
		{
			ans = s;
			st = l;
			en = r;
		}
		r++;
	}
	FOR(i, l, r)
	cout << i << " ";
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <set>
#include <list>
#include <queue>
#include <map>
using namespace std;
#define _CRT_SECURE_NO_WARNINGS
#define Abs                           \
	ios_base::sync_with_stdio(false); \
	cout.tie(NULL);                   \
	cin.tie(NULL);
#define FOR(i, b, a) for (ll i = b; i < a; i++)
#define FOR1(i, b, a) for (ll i = b; i <= a; i++)
#define FORd(i, b, a) for (int i = (a)-1; i >= b; i--)
const double PI = acos(-1);
#define all(v) ((v).begin()), ((v).end())
#define allr(v) ((v).rbegin()), ((v).rend())
#define iq(v)   v.resize(unique(v.begin(), v.end()) - v.begin())
#define endl "\n"
#define sz(v) ((ll)((v).size()))
#define fx(n)           fixed << setprecision(n)
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef pair<long long, long long> pii;
int main()
{
	Abs;
	ll n, k;
	cin >> n;
	vi v(n + 1), pre(n + 1);
	map<ll, ll> m;
	set<ll> range;
	FOR1(i, 1, n)
	{
		cin >> v[i];
		m[v[i]] = i;
	}
	cin >> k;
	sort(v.begin() + 1, v.end());
	FOR1(i, 1, n)
	{
		pre[i] = pre[i - 1] + v[i];
	}
	ll l = 1, r = 2, st = 1, en = k, ans = 0, s = 0;
	while (r <= k)
	{
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		r++;
	}
	ans = s;
	while (r <= n)
	{
		s -= (pre[r - 1] - pre[l] - v[l] * (r - l - 1));
		l++;
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		if (ans > s)
		{
			ans = s;
			st = l;
			en = r;
		}
		r++;
	}
	FOR1(i, st, en)
	range.insert(m[v[i]]);
	for (auto it : range)
		cout << it << " ";
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <set>
#include <list>
#include <queue>
#include <map>
using namespace std;
#define _CRT_SECURE_NO_WARNINGS
#define Abs                           \
	ios_base::sync_with_stdio(false); \
	cout.tie(NULL);                   \
	cin.tie(NULL);
#define FOR(i, b, a) for (ll i = b; i < a; i++)
#define FOR1(i, b, a) for (ll i = b; i <= a; i++)
#define FORd(i, b, a) for (int i = (a)-1; i >= b; i--)
const double PI = acos(-1);
#define all(v) ((v).begin()), ((v).end())
#define allr(v) ((v).rbegin()), ((v).rend())
#define iq(v)   v.resize(unique(v.begin(), v.end()) - v.begin())
#define endl "\n"
#define sz(v) ((ll)((v).size()))
#define fx(n)           fixed << setprecision(n)
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef pair<long long, long long> pii;
int main()
{
	Abs;
	ll n, k;
	cin >> n;
	vi v(n + 1), pre(n + 1);
	map<ll, ll> m;
	set<ll> range;
	FOR1(i, 1, n)
	{
		cin >> v[i];
		m[v[i]] = i;
	}
	cin >> k;
	sort(v.begin() + 1, v.end());
	FOR(i, 1, n)
	{
		pre[i] = pre[i - 1] + v[i];
	}
	ll l = 1, r = 2, st = 1, en = k, ans = 0, s = 0;
	while (r <= k)
	{
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		r++;
	}
	ans = s;
	while (r <= n)
	{
		s -= (pre[r - 1] - pre[l] - v[l] * (r - l - 1));
		l++;
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		if (ans > s)
		{
			ans = s;
			st = l;
			en = r;
		}
		r++;
	}
	FOR1(i, st, en)
	range.insert(m[v[i]]);
	for (auto it : range)
		cout << it << " ";
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <set>
#include <list>
#include <queue>
#include <map>
using namespace std;
#define _CRT_SECURE_NO_WARNINGS
#define Abs                           \
	ios_base::sync_with_stdio(false); \
	cout.tie(NULL);                   \
	cin.tie(NULL);
#define FOR(i, b, a) for (ll i = b; i < a; i++)
#define FOR1(i, b, a) for (ll i = b; i <= a; i++)
#define FORd(i, b, a) for (int i = (a)-1; i >= b; i--)
const double PI = acos(-1);
#define all(v) ((v).begin()), ((v).end())
#define allr(v) ((v).rbegin()), ((v).rend())
#define iq(v)   v.resize(unique(v.begin(), v.end()) - v.begin())
#define endl "\n"
#define sz(v) ((ll)((v).size()))
#define fx(n)           fixed << setprecision(n)
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef pair<long long, long long> pii;
int main()
{
	Abs;
	ll n, k;
	cin >> n;
	vi v(n + 1), pre(n + 1), range;
	map<ll, ll> m;
	FOR1(i, 1, n)
	{
		cin >> v[i];
		m[v[i]] = i;
	}
	cin >> k;
	sort(v.begin() + 1, v.end());
	FOR1(i, 1, n)
	{
		pre[i] = pre[i - 1] + v[i];
	}
	ll l = 1, r = 2, st = 1, en = k, ans = 0, s = 0;
	while (r <= k)
	{
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		r++;
	}
	ans = s;
	while (r <= n)
	{
		s -= (pre[r - 1] - pre[l] - v[l] * (r - l - 1));
		l++;
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		if (ans > s)
		{
			ans = s;
			st = l;
			en = r;
		}
		r++;
	}
	vi ans1;
	for (int i = st; i <= en; i++)
	{
		ans1.push_back(m[v[i]]);
	}
	sort(all(ans1));
	for (int i = 0; i < ans1.size(); i++)
		cout << ans1[i] << " ";
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <set>
#include <list>
#include <queue>
#include <map>
using namespace std;
#define _CRT_SECURE_NO_WARNINGS
#define Abs                           \
	ios_base::sync_with_stdio(false); \
	cout.tie(NULL);                   \
	cin.tie(NULL);
#define FOR(i, b, a) for (ll i = b; i < a; i++)
#define FOR1(i, b, a) for (ll i = b; i <= a; i++)
#define FORd(i, b, a) for (int i = (a)-1; i >= b; i--)
const double PI = acos(-1);
#define all(v) ((v).begin()), ((v).end())
#define allr(v) ((v).rbegin()), ((v).rend())
#define iq(v)   v.resize(unique(v.begin(), v.end()) - v.begin())
#define endl "\n"
#define sz(v) ((ll)((v).size()))
#define fx(n)           fixed << setprecision(n)
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef pair<long long, long long> pii;
int main()
{
	Abs;
	ll n, k;
	cin >> n;
	vector<ll> v(n + 1), pre(n + 1), range;
	map<ll, ll> m;
	for (int i = 1; i <= n; i++)
	{
		cin >> v[i];
		m[v[i]] = i;
	}
	cin >> k;
	sort(v.begin() + 1, v.end());
	for (int i = 1; i <= n; i++)
		pre[i] = pre[i - 1] + v[i];
	ll s = 0, st = 1, en = k, l = 1, r = 2, ans;
	while (r <= k)
	{
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		r++;
	}
	ans = s;
	while (r <= n)
	{
		s -= (pre[r - 1] - pre[l] - v[l] * (r - l - 1));
		l++;
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		if (ans > s)
		{
			ans = s;
			st = l;
			en = r;
		}
		r++;
	}
	FOR1(i, st, en)
	range.push_back(m[v[i]]);
	sort(all(range));
	for (auto i : range)
		cout << i << " ";
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <set>
#include <list>
#include <queue>
#include <map>
using namespace std;
#define _CRT_SECURE_NO_WARNINGS
#define Abs                           \
	ios_base::sync_with_stdio(false); \
	cout.tie(NULL);                   \
	cin.tie(NULL);
#define FOR(i, b, a) for (ll i = b; i < a; i++)
#define FOR1(i, b, a) for (ll i = b; i <= a; i++)
#define FORd(i, b, a) for (int i = (a)-1; i >= b; i--)
const double PI = acos(-1);
#define all(v) ((v).begin()), ((v).end())
#define allr(v) ((v).rbegin()), ((v).rend())
#define iq(v)   v.resize(unique(v.begin(), v.end()) - v.begin())
#define endl "\n"
#define sz(v) ((ll)((v).size()))
#define fx(n)           fixed << setprecision(n)
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef pair<long long, long long> pii;
int main()
{
	Abs;
	ll n, k;
	cin >> n;
	vi v(n + 1), pre(n + 1);
	map<ll, ll> m;
	multiset<ll> range;
	FOR1(i, 1, n)
	{
		cin >> v[i];
		m[v[i]] = i;
	}
	cin >> k;
	sort(v.begin() + 1, v.end());
	FOR1(i, 1, n)
	{
		pre[i] = pre[i - 1] + v[i];
	}
	ll l = 1, r = 2, st = 1, en = k, ans = 0, s = 0;
	while (r <= k)
	{
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		r++;
	}
	ans = s;
	while (r <= n)
	{
		s -= (pre[r - 1] - pre[l] - v[l] * (r - l - 1));
		l++;
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		if (ans > s)
		{
			ans = s;
			st = l;
			en = r;
		}
		r++;
	}
	FOR1(i, st, en)
	range.insert(m[v[i]]);
	for (auto it : range)
		cout << it << " ";
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <set>
#include <list>
#include <queue>
#include <map>
using namespace std;
#define _CRT_SECURE_NO_WARNINGS
#define Abs                           \
	ios_base::sync_with_stdio(false); \
	cout.tie(NULL);                   \
	cin.tie(NULL);
#define FOR(i, b, a) for (ll i = b; i < a; i++)
#define FOR1(i, b, a) for (ll i = b; i <= a; i++)
#define FORd(i, b, a) for (int i = (a)-1; i >= b; i--)
const double PI = acos(-1);
#define all(v) ((v).begin()), ((v).end())
#define allr(v) ((v).rbegin()), ((v).rend())
#define iq(v)   v.resize(unique(v.begin(), v.end()) - v.begin())
#define endl "\n"
#define sz(v) ((ll)((v).size()))
#define fx(n)           fixed << setprecision(n)
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef pair<long long, long long> pii;
int main()
{
	Abs;
	ll n, k;
	cin >> n;
	vi v(n + 1), pre(n + 1);
	map<ll, ll> m;
	multiset<ll> range;
	FOR1(i, 1, n)
	{
		cin >> v[i];
		m[v[i]] = i;
	}
	cin >> k;
	sort(v.begin() + 1, v.end());
	FOR(i, 1, n)
	{
		pre[i] = pre[i - 1] + v[i];
	}
	ll l = 1, r = 2, st = 1, en = k, ans = 0, s = 0;
	while (r <= k)
	{
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		r++;
	}
	ans = s;
	while (r <= n)
	{
		s -= (pre[r - 1] - pre[l] - v[l] * (r - l - 1));
		l++;
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		if (ans > s)
		{
			ans = s;
			st = l;
			en = r;
		}
		r++;
	}
	FOR1(i, st, en)
	range.insert(m[v[i]]);
	for (auto it : range)
		cout << it << " ";
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <set>
#include <list>
#include <queue>
#include <map>
using namespace std;
#define _CRT_SECURE_NO_WARNINGS
#define Abs                           \
	ios_base::sync_with_stdio(false); \
	cout.tie(NULL);                   \
	cin.tie(NULL);
#define FOR(i, b, a) for (ll i = b; i < a; i++)
#define FOR1(i, b, a) for (ll i = b; i <= a; i++)
#define FORd(i, b, a) for (int i = (a)-1; i >= b; i--)
const double PI = acos(-1);
#define all(v) ((v).begin()), ((v).end())
#define allr(v) ((v).rbegin()), ((v).rend())
#define iq(v)   v.resize(unique(v.begin(), v.end()) - v.begin())
#define endl "\n"
#define sz(v) ((ll)((v).size()))
#define fx(n)           fixed << setprecision(n)
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef pair<long long, long long> pii;
int main()
{
	Abs;
	ll n, k;
	cin >> n;
	vi v(n + 1), pre(n + 1), range;
	map<ll, ll> m;
	FOR1(i, 1, n)
	{
		cin >> v[i];
		m[v[i]] = i;
	}
	cin >> k;
	sort(v.begin() + 1, v.end());
	FOR(i, 1, n)
	{
		pre[i] = pre[i - 1] + v[i];
	}
	ll l = 1, r = 2, st = 1, en = k, ans = 0, s = 0;
	while (r <= k)
	{
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		r++;
	}
	ans = s;
	while (r <= n)
	{
		s -= (pre[r - 1] - pre[l] - v[l] * (r - l - 1));
		l++;
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		if (ans > s)
		{
			ans = s;
			st = l;
			en = r;
		}
		r++;
	}
	FOR1(i, st, en)
	range.push_back(m[v[i]]);
	sort(all(range));
	for (auto it : range)
		cout << it << " ";
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <set>
#include <list>
#include <queue>
#include <map>
using namespace std;
#define _CRT_SECURE_NO_WARNINGS
#define Abs                           \
	ios_base::sync_with_stdio(false); \
	cout.tie(NULL);                   \
	cin.tie(NULL);
#define FOR(i, b, a) for (ll i = b; i < a; i++)
#define FOR1(i, b, a) for (ll i = b; i <= a; i++)
#define FORd(i, b, a) for (int i = (a)-1; i >= b; i--)
const double PI = acos(-1);
#define all(v) ((v).begin()), ((v).end())
#define allr(v) ((v).rbegin()), ((v).rend())
#define iq(v)   v.resize(unique(v.begin(), v.end()) - v.begin())
#define endl "\n"
#define sz(v) ((ll)((v).size()))
#define fx(n)           fixed << setprecision(n)
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef pair<long long, long long> pii;
int main()
{
	Abs;
	ll n, k;
	cin >> n;
	vi v(n + 1), pre(n + 1), range;
	map<ll, ll> m;
	FOR1(i, 1, n)
	{
		cin >> v[i];
		m[v[i]] = i;
	}
	cin >> k;
	sort(v.begin() + 1, v.end());
	FOR1(i, 1, n)
	{
		pre[i] = pre[i - 1] + v[i];
	}
	ll l = 1, r = 2, st = 1, en = k, ans = 0, s = 0;
	while (r <= k)
	{
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		r++;
	}
	ans = s;
	while (r <= n)
	{
		s -= (pre[r - 1] - pre[l] - v[l] * (r - l - 1));
		l++;
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		if (ans > s)
		{
			ans = s;
			st = l;
			en = r;
		}
		r++;
	}
	FOR1(i, st, en)
	range.push_back(m[v[i]]);
	sort(all(range));
	for (auto it : range)
		cout << it << " ";
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <set>
#include <list>
#include <queue>
#include <map>
using namespace std;
#define _CRT_SECURE_NO_WARNINGS
#define Abs                           \
	ios_base::sync_with_stdio(false); \
	cout.tie(NULL);                   \
	cin.tie(NULL);
#define FOR(i, b, a) for (ll i = b; i < a; i++)
#define FOR1(i, b, a) for (ll i = b; i <= a; i++)
#define FORd(i, b, a) for (int i = (a)-1; i >= b; i--)
const double PI = acos(-1);
#define all(v) ((v).begin()), ((v).end())
#define allr(v) ((v).rbegin()), ((v).rend())
#define iq(v)   v.resize(unique(v.begin(), v.end()) - v.begin())
#define endl "\n"
#define sz(v) ((ll)((v).size()))
#define fx(n)           fixed << setprecision(n)
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef pair<long long, long long> pii;
int main()
{
	Abs;
	ll n, k;
	cin >> n;
	vi v(n + 1), pre(n + 1);
	FOR1(i, 1, n)
	cin >> v[i];
	cin >> k;
	sort(v.begin()+1,v.end());
	FOR(i, 1, n)
	{
		pre[i] = pre[i - 1] + v[i];
	}
	ll l = 1, r = 2, st = 1, en = k, ans = 0, s = 0;
	while (r <= k)
	{
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		r++;
	}
	ans = s;
	while (r <= n)
	{
		s -= (pre[r - 1] - pre[l] - v[l] * (r - l - 1));
		l++;
		s += (v[r] * (r - l) - (pre[r - 1] - pre[l - 1]));
		if (ans > s)
		{
			ans = s;
			st = l;
			en = r;
		}
		r++;
	}
	FOR(i, l, r)
	cout << i << " ";
}


#include <algorithm>
#include <iostream>
#include <string.h>
#include <cstdlib>
#include <vector>
#include <string>
#include <bitset>
#include <math.h>
#include <queue>
#include <stack>
#include <set>
#include <map>

typedef long long ll;
typedef long double ld;

const ll MOD = 1e9 + 7, INF = 1e18 + 1;

using namespace std;

ll a[1000000], n, k, psum, pans, ans, ind, sorted[1000000];

bool Comp (int i, int j)
{
	return a[i] < a[j];
}

int main ()
{
	cin >> n;

	for (ll i = 0; i < n; i++)
	{
		scanf ("%lld", &a[i]);
		sorted[i] = i;
	}

	sort (sorted, sorted + n, Comp);

	cin >> k;

	for (ll i = 0; i < k; i++)
	{
		pans += i * a[sorted[i]] - psum;
		psum += a[sorted[i]];
	}

	ans = pans;

	for (ll i = 0; i < n - k; i++)
	{
		psum -= a[sorted[i]];
		pans -= psum - (k - 1) * a[sorted[i]];
		pans += (k - 1) * a[sorted[i + k]] - psum;
		psum += a[sorted[i + k]];

		if (pans < ans)
		{
			ans = pans;
			ind = i + 1;
		}
	}

	for (ll i = 0; i < k; i++)
		printf ("%lld ", sorted[ind + i] + 1);
}


#include <algorithm>
#include <iostream>
#include <string.h>
#include <cstdlib>
#include <vector>
#include <string>
#include <bitset>
#include <math.h>
#include <queue>
#include <stack>
#include <set>
#include <map>

typedef long long ll;
typedef long double ld;

const ll MOD = 1e9 + 7, INF = 1e18 + 1;

using namespace std;

ll a[1000000], n, k, psum, pans, ans, ind;

int main ()
{
	cin >> n;

	for (ll i = 0; i < n; i++)
		scanf ("%lld", &a[i]);

	cin >> k;

	for (ll i = 0; i < k; i++)
	{
		pans += i * a[i] - psum;
		psum += a[i];
	}

	ans = pans;

	for (ll i = 0; i < n - k; i++)
	{
		psum -= a[i];
		pans -= psum - (k - 1) * a[i];
		pans += (k - 1) * a[i + k] - psum;
		psum += a[i + k];

		if (pans < ans)
		{
			ans = pans;
			ind = i + k - 1;
		}
	}

	for (ll i = 1; i <= k; i++)
		printf ("%d ", ind + i);
}


//Program.cpp
//Author : Aaryan Srivastava
#include <bits/stdc++.h>
#include <random>
#include <chrono>
#define pb push_back
#define popb pop_back
#define ull unsigned long long
#define beg begin
#define mp make_pair
#define pii pair<int, int>
#define piii pair<int,pii>
#define rep(i,n) for(int (i) = 0 ; i < (n) ; i++)
#define repA(i,x,y) for(int i = (x) ; i <= (y) ; i++)
#define repD(i,x,y) for(int i = (x) ; i >= (y) ; i--)
#define all(c) (c).begin(),(c).end()
#define ff first
#define ss second
#define fill(a,val) memset(a,val,sizeof(a))
#define Randomize mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
using ll = long long;
#define int ll
const int N = 2*1e5 +5 ;
const int mod = 1e9 + 7 ;
const int inf = 1e18 ;
const int SZ = 101 ;
const double eps = 1e-9 ;
using namespace std;

#ifdef AaryanS
#define mycout cout
#define mycerr cerr
#endif

#ifndef AaryanS
#define mycout if(false) cout
#define mycerr if(false) cerr
#define AaryanS 0
#endif

void solve()
{
    int n , k ;
    cin >> n;
    vector<pii>a(n) ;
    vector<int> pfx(n,0) ;
    rep(i,n) cin >> a[i].ff , a[i].ss = i ;
    cin >> k ;
    rep(i,n){
        pfx[i] = a[i].ff ;
        if(i)
            pfx[i] += pfx[i-1] ;
    }
    sort(all(a)) ;
    int l = 0 , r = k-1 , ans = 0 ;
    int mul = -(k-1) ;
    rep(i,k){
        // cout << mul << " x " ;
        // cout << a[i].ff << "\n"  ;
        ans += mul*a[i].ff , mul += 2;
    }
    piii xx = {ans,{0,k-1}};
    for(int i = 0 , j = k-1; i < n && j < n-1 ; ++i, ++j){
        ans += (k-1)*a[i].ff ;
        // cout << ans << endl ;
        ans -= 2*pfx[j] - 2*pfx[i+1-1] ;
        // cout << ans << endl ;
        ans += (k-1)*a[j+1].ff ;
        // cout << i << " " << j << " " << ans <<endl ;
        xx = min(xx, {ans,{i+1,j+1}}) ;
    }
    // cout << xx.ff << " " << xx.ss.ff << " " << xx.ss.ss << endl ;
    repA(f,xx.ss.ff,xx.ss.ss)
        cout << a[f].ss + 1 << " " ;
}

int32_t main(int32_t argc, char *argv[])
{
    double t1 = clock() ;
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int TC = 1, t = 0;
    //cin >> TC ;
    while(t++ < TC)
    {
        //cout << "Case " << t << ":\n" ;
        solve();
    }
    mycerr << "Time : " << 1000 *(clock() - t1)/CLOCKS_PER_SEC << " ms\n" ;
    return 0;
}


//Program.cpp
//Author : Aaryan Srivastava
#include <bits/stdc++.h>
#include <random>
#include <chrono>
#define pb push_back
#define popb pop_back
#define ull unsigned long long
#define beg begin
#define mp make_pair
#define pii pair<int, int>
#define piii pair<int,pii>
#define rep(i,n) for(int (i) = 0 ; i < (n) ; i++)
#define repA(i,x,y) for(int i = (x) ; i <= (y) ; i++)
#define repD(i,x,y) for(int i = (x) ; i >= (y) ; i--)
#define all(c) (c).begin(),(c).end()
#define ff first
#define ss second
#define fill(a,val) memset(a,val,sizeof(a))
#define Randomize mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
using ll = long long;
#define int ll
const int N = 2*1e5 +5 ;
const int mod = 1e9 + 7 ;
const int inf = 1e18 ;
const int SZ = 101 ;
const double eps = 1e-9 ;
using namespace std;

#ifdef AaryanS
#define mycout cout
#define mycerr cerr
#endif

#ifndef AaryanS
#define mycout if(false) cout
#define mycerr if(false) cerr
#define AaryanS 0
#endif

void solve()
{
    int n , k ;
    cin >> n;
    vector<pii>a(n) ;
    vector<int> pfx(n,0) ;
    rep(i,n) cin >> a[i].ff , a[i].ss = i ;
    cin >> k ;
    sort(all(a)) ;
    rep(i,n){
        pfx[i] = a[i].ff ;
        if(i)
            pfx[i] += pfx[i-1] ;
        // cout << pfx[i] << " ";
    }
    // cout << endl ;
    int l = 0 , r = k-1 , ans = 0 ;
    int mul = -(k-1) ;
    rep(i,k){
        // cout << mul << " x " ;
        // cout << a[i].ff << "\n"  ;
        ans += mul*a[i].ff , mul += 2;
    }
    piii xx = {ans,{0,k-1}};
    // cout << ans << "w\n" ;
    for(int i = 1 , j = k ; i < n && j < n ; ++i, ++j){
        ans += (k-1)*a[i-1].ff ;
        // cout << a[i].ff << " " << a[j].ff << endl ;
        // cout << ans << endl ;
        ans -= 2*pfx[j-1] - 2*pfx[i-1] ;
        // cout << 2*(pfx[j-1] - pfx[i-1]) << ' ' ;
        // cout << ans << endl ;
        ans += (k-1)*a[j].ff ;
        // cout << i << " " << j << " " << ans << "\n--------- \n" ;
        xx = min(xx, {ans,{i+1,j+1}}) ;
    }
    // cout << xx.ff << " " << xx.ss.ff << " " << xx.ss.ss << endl ;
    repA(f,xx.ss.ff,xx.ss.ss)
        cout << a[f-1].ss + 1 << " " ;
}

int32_t main(int32_t argc, char *argv[])
{
    double t1 = clock() ;
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int TC = 1, t = 0;
    //cin >> TC ;
    while(t++ < TC)
    {
        //cout << "Case " << t << ":\n" ;
        solve();
    }
    mycerr << "Time : " << 1000 *(clock() - t1)/CLOCKS_PER_SEC << " ms\n" ;
    return 0;
}


//Program.cpp
//Author : Aaryan Srivastava
#include <bits/stdc++.h>
#include <random>
#include <chrono>
#define pb push_back
#define popb pop_back
#define ull unsigned long long
#define beg begin
#define mp make_pair
#define pii pair<int, int>
#define piii pair<int,pii>
#define rep(i,n) for(int (i) = 0 ; i < (n) ; i++)
#define repA(i,x,y) for(int i = (x) ; i <= (y) ; i++)
#define repD(i,x,y) for(int i = (x) ; i >= (y) ; i--)
#define all(c) (c).begin(),(c).end()
#define ff first
#define ss second
#define fill(a,val) memset(a,val,sizeof(a))
#define Randomize mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
using ll = long long;
#define int ll
const int N = 2*1e5 +5 ;
const int mod = 1e9 + 7 ;
const int inf = 1e18 ;
const int SZ = 101 ;
const double eps = 1e-9 ;
using namespace std;

#ifdef AaryanS
#define mycout cout
#define mycerr cerr
#endif

#ifndef AaryanS
#define mycout if(false) cout
#define mycerr if(false) cerr
#define AaryanS 0
#endif

void solve()
{
    int n , k ;
    cin >> n;
    vector<pii>a(n) ;
    vector<int> pfx(n,0) ;
    rep(i,n) cin >> a[i].ff , a[i].ss = i ;
    cin >> k ;
    sort(all(a)) ;
    rep(i,n){
        pfx[i] = a[i].ff ;
        if(i)
            pfx[i] += pfx[i-1] ;
        // cout << pfx[i] << " ";
    }
    // cout << endl ;
    int l = 0 , r = k-1 , ans = 0 ;
    int mul = -(k-1) ;
    rep(i,k){
        // cout << mul << " x " ;
        // cout << a[i].ff << "\n"  ;
        ans += mul*a[i].ff , mul += 2;
    }
    piii xx = {ans,{0,k-1}};
    // cout << ans << "w\n" ;
    for(int i = 1 , j = k ; i < n && j < n ; ++i, ++j){
        ans += (k-1)*a[i-1].ff ;
        // cout << a[i].ff << " " << a[j].ff << endl ;
        // cout << ans << endl ;
        ans -= 2*pfx[j-1] - 2*pfx[i-1] ;
        // cout << 2*(pfx[j-1] - pfx[i-1]) << ' ' ;
        // cout << ans << endl ;
        ans += (k-1)*a[j].ff ;
        // cout << i << " " << j << " " << ans << "\n--------- \n" ;
        xx = min(xx, {ans,{i,j}}) ;
    }
    // cout << xx.ff << " " << xx.ss.ff << " " << xx.ss.ss << endl ;
    repA(f,xx.ss.ff,xx.ss.ss)
        cout << a[f].ss + 1 << " " ;
}

int32_t main(int32_t argc, char *argv[])
{
    double t1 = clock() ;
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int TC = 1, t = 0;
    //cin >> TC ;
    while(t++ < TC)
    {
        //cout << "Case " << t << ":\n" ;
        solve();
    }
    mycerr << "Time : " << 1000 *(clock() - t1)/CLOCKS_PER_SEC << " ms\n" ;
    return 0;
}


/* -*- coding: utf-8 -*-
 *
 * 0371E.cc: E. Subway Innovation
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>

using namespace std;

/* constant */

const int MAX_N = 300000;
const long long LINF = ~(1ULL << 63);

/* typedef */

typedef long long ll;
typedef pair<int,int> pii;

/* global variables */

pii ps[MAX_N];
ll xss[MAX_N + 1], ass[MAX_N + 1], bss[MAX_N + 1];

/* subroutines */

/* main */

int main() {
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);

  int n;
  scanf("%d", &n);

  for (int i = 0; i < n; i++)
    scanf("%d", &ps[i].first), ps[i].second = i;
  sort(ps, ps + n);

  int k;
  scanf("%d", &k);

  for (int i = 0; i < n; i++)
    xss[i + 1] = xss[i] + ps[i].first;
  for (int i = 0; i < n; i++)
    ass[i + 1] = ass[i] + (ll)i * ps[i].first;
  for (int i = n - 1; i >= 0; i--)
    bss[i] = bss[i + 1] + (ll)(n - 1 - i) * ps[i].first;

  ll minsum = LINF;
  int mini = -1;

  for (int i = 0, j = k; j <= n; i++, j++) {
    ll s0 = ass[j] - ass[i] - (xss[j] - xss[i]) * i;
    ll s1 = bss[i] - bss[j] - (xss[j] - xss[i]) * (n - j);
    ll sum = s0 - s1;
    //printf("%d-%d: %lld-%lld=%lld\n", i, j, s0, s1, sum);
    if (minsum > sum) minsum = sum, mini = i;
  }
  //printf("minsum=%lld, mini=%d\n", minsum, mini);

  for (int i = 0; i < k; i++) {
    if (i) putchar(' ');
    printf("%d", ps[mini + i].second + 1);
  }
  putchar('\n');
  return 0;
}


//Link : https://codeforces.com/problemset/problem/1098/C

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 300005

pair<ll,int> in[N];
void solve() {
  int n;scanf("%d ", &n);
  ll ret = 1e18;
  int ind = 0;
  for(int i=0;i<n;++i) {
    scanf("%lld ", &in[i].first);
    in[i].second = i+1;
  }
  sort(in,in+n);
  int k;scanf("%d ", &k);
  ll cur = 0;
  ll sum = 0;
  for(int i=k-1;i>=0;--i) {
    cur += sum - in[i].first*(k-1-i);
    sum += in[i].first;
  }
  for(int i=0;i+k-1<n;++i) {
    if(ret>cur) {
      ret = cur;
      ind = i;
    }
    cur -= sum - in[i].first*k;
    sum -= in[i].first;
    if(i+k<n) {
      cur += (ll)in[i+k].first*(k-1) - sum;
      sum += in[i+k].first;
    }
  }
  for(int i=ind;i<ind+k;++i) {
    printf("%d ", in[i].second);
  }
}

int main() {
    //freopen("input.txt","r",stdin);
    solve();
    return 0;
}


//Link : https://codeforces.com/problemset/problem/1098/C

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 300005

pair<ll,int> in[N];
void solve() {
  int n;scanf("%d ", &n);
  ll ret = 8e18;
  int ind = 0;
  for(int i=0;i<n;++i) {
    scanf("%lld ", &in[i].first);
    in[i].second = i+1;
  }
  sort(in,in+n);
  int k;scanf("%d ", &k);
  ll cur = 0;
  ll sum = 0;
  for(int i=k-1;i>=0;--i) {
    cur += sum - in[i].first*(k-1-i);
    sum += in[i].first;
  }
  for(int i=0;i+k-1<n;++i) {
    if(ret>cur) {
      ret = cur;
      ind = i;
    }
    cur -= sum - in[i].first*(k-1);
    if(i+k<n) {
      cur += (ll)in[i+k].first*(k-1) - sum;
      sum += in[i+k].first;
    }
    sum -= in[i].first;

  }
  for(int i=ind;i<ind+k;++i) {
    printf("%d ", in[i].second);
  }
}

int main() {
    //freopen("input.txt","r",stdin);
    solve();
    return 0;
}


//Link : https://codeforces.com/problemset/problem/1098/C

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 300005

pair<ll,int> in[N];
void solve() {
  int n;scanf("%d ", &n);
  ll ret = 8e18;
  int ind = 0;
  for(int i=0;i<n;++i) {
    scanf("%lld ", &in[i].first);
    in[i].second = i+1;
  }
  sort(in,in+n);
  int k;scanf("%d ", &k);
  ll cur = 0;
  ll sum = 0;
  for(int i=k-1;i>=0;--i) {
    cur += sum - in[i].first*(k-1-i);
    sum += in[i].first;
  }
  for(int i=0;i+k-1<n;++i) {
    if(ret>cur) {
      ret = cur;
      ind = i;
    }
    sum -= in[i].first;
    cur -= sum - in[i].first*(k-1);
    if(i+k<n) {
      cur += (ll)in[i+k].first*(k-1) - sum;
      sum += in[i+k].first;
    }
  }
  for(int i=ind;i<ind+k;++i) {
    printf("%d ", in[i].second);
  }
}

int main() {
    //freopen("input.txt","r",stdin);
    solve();
    return 0;
}


//Link : https://codeforces.com/problemset/problem/1098/C

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 300005

pair<ll,int> in[N];
void solve() {
  int n;scanf("%d ", &n);
  ll ret = 1e18;
  int ind = 0;
  for(int i=0;i<n;++i) {
    scanf("%lld ", &in[i].first);
    in[i].second = i+1;
  }
  sort(in,in+n);
  int k;scanf("%d ", &k);
  ll cur = 0;
  ll sum = 0;
  for(int i=k-1;i>=0;--i) {
    cur += sum - in[i].first*(k-1-i);
    sum += in[i].first;
  }
  for(int i=0;i+k-1<n;++i) {
    if(ret>cur) {
      ret = cur;
      ind = i;
    }
    cur -= sum - in[i].first*k;
    sum -= in[i].first;
    if(i+k<n) {
      cur += (ll)in[i+k].first*(k-1) - sum;
      sum += in[i].first;
    }
  }
  for(int i=ind;i<ind+k;++i) {
    printf("%d ", in[i].second);
  }
}

int main() {
    //freopen("input.txt","r",stdin);
    solve();
    return 0;
}


//Link : https://codeforces.com/problemset/problem/1098/C

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 300005

pair<ll,int> in[N];
void solve() {
  int n;scanf("%d ", &n);
  ll ret = 8e18;
  int ind = 0;
  for(int i=0;i<n;++i) {
    scanf("%lld ", &in[i].first);
    in[i].second = i+1;
  }
  sort(in,in+n);
  int k;scanf("%d ", &k);
  ll cur = 0;
  ll sum = 0;
  for(int i=k-1;i>=0;--i) {
    cur += sum - in[i].first*(k-1-i);
    sum += in[i].first;
  }
  for(int i=0;i+k-1<n;++i) {
    if(ret>cur) {
      ret = cur;
      ind = i;
    }
    cur -= sum - in[i].first*k;
    sum -= in[i].first;
    if(i+k<n) {
      cur += (ll)in[i+k].first*(k-1) - sum;
      sum += in[i+k].first;
    }
  }
  for(int i=ind;i<ind+k;++i) {
    printf("%d ", in[i].second);
  }
}

int main() {
    //freopen("input.txt","r",stdin);
    solve();
    return 0;
}


#include <stdio.h>
#include <algorithm>

using namespace std;

typedef long long lli;

class q {
public:
	int idx;
	lli x;
};

bool cmp(const q &i, const q &j) {
	return i.x < j.x;
}

q a[300002];
lli p[300002], s[300002];
int n, k;

int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		scanf("%lld", &a[i].x);
		a[i].idx = i;
	}
	sort(a + 1, a + n + 1, cmp);
	for (int i = 1; i <= n; i++)
		p[i] = p[i - 1] + a[i].x;
	for (int i = n; i >= 1; i--)
		s[i] = s[i + 1] + a[i].x;
	scanf("%d", &k);
	lli res = 0;
	int idx = 1;
	for (int i = 1; i <= k; i++) {
		if (i == 1) res += (p[k] - p[1]) - (k - 1)*a[i].x;
		else if (i == k) res += (k - 1)*a[i].x - p[k - 1];
		else res += (i - 1)*a[i].x - p[i - 1] - (k - i)*a[i].x + (p[k] - p[i]);
	}
	lli sum = res;
	for (int i = k + 1; i <= n; i++) {
		sum -= 2 * ((p[i - 1] - p[i - k]) - (k - 1) * a[i - k].x);
		sum += 2 * ((k - 1) * a[i].x - (p[i - 1] - p[i - k]));
		if (sum < res) {
			res = sum; idx = i - k + 1;
		}
	}
	for (int i = idx; i < idx + k; i++)
		printf("%d ", a[i].idx);
	puts("");
	return 0;
}


#include <bits/stdc++.h>
#define MAX_SIZE 300011
typedef long long ll;
using namespace std;

pair<int, int> station[MAX_SIZE];
int n, k;

deque<int> q;

int main() {
	int i, idx = -1;
	ll prefix = 0, curr = 0, ans = 7e18;
	scanf("%d", &n);
	for (i = 1; i <= n; ++i) {
		scanf("%d", &station[i].first);
		station[i].second = i;
	}
	scanf("%d", &k);
	sort(station + 1, station + 1 + n);

	for (i = 1; i <= n; ++i) {
		if (i == 1) {
			prefix += station[i].first;
			q.push_back(station[i].first);
		} else {
			curr += 1ll * station[i].first * (int) q.size() - prefix;
			prefix += station[i].first;
			q.push_back(station[i].first);
		}

		if (i > k) {
			prefix -= q.front();
			q.pop_front();
			curr -= prefix - 1ll * station[i-k].first * k;
		}

		if (i >= k) {
			if (ans > curr) {
				idx = i;
				ans = curr;
			}
		}
		// cout << prefix << " " << curr << endl;
	}

	for (i = idx; i > idx - k; --i) {
		printf("%d ", station[i].second);
	}
	printf("\n");
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fu(i,a,b) for(int i=a; i<=b; i++)

typedef long long ll;

const int N = 3e5+10;

struct pack
{
    int x, id;

    bool operator < (pack A) const
    {
        return x < A.x;
    }
} a[N];

int n, k, start;
ll num, t[N], d;

ll sum(int l, int r)
{
    return t[r] - t[l-1];
}

int main()
{
    fastio;
    cin >> n;
    fu(i, 1, n)
    {
        cin >> a[i].x;
        a[i].id = i;
    }
    sort(a+1, a+1+n);
    cin >> k;
    fu(i, 1, n) t[i] = t[i-1] + a[i].x;
    fu(i, 1, k) d += a[i].x*i - sum(1, i-1);
    num = d;
    start = 1;
    fu(i, 2, n-k+1)
    {
        d -= sum(i, i+k-2);
        d += a[i-1].x*(k-1);
        d += a[i+k-1].x*(k-1);
        d -= sum(i, i+k-2);
        if (d < num)
        {
            num = d;
            start = i;
        }
    }
    fu(i, start, start+k-1) cout << a[i].id << " ";
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fu(i,a,b) for(int i=a; i<=b; i++)

typedef long long ll;

const int N = 3e5+10;

struct pack
{
    int x, id;

    bool operator < (pack A) const
    {
        return x < A.x;
    }
} a[N];

int n, k, start;
ll num, t[N], d;

ll sum(int l, int r)
{
    return t[r] - t[l-1];
}

int main()
{
    fastio;
    cin >> n;
    fu(i, 1, n)
    {
        cin >> a[i].x;
        a[i].id = i;
    }
    sort(a+1, a+1+n);
    cin >> k;
    fu(i, 1, n) t[i] = t[i-1] + a[i].x;
    fu(i, 1, k) d += a[i].x*i - sum(1, i-1);
    num = d;
    start = 1;
    fu(i, 2, n-k+1)
    {
        ll p = d;
        p -= sum(i, i+k-2);
        p += a[i-1].x*(k-1);
        p += a[i+k-1].x*(k-1);
        p -= sum(i, i+k-2);
        if (p < d)
        {
            d = p;
            start = i;
        }
    }
    fu(i, start, start+k-1) cout << a[i].id << " ";
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fu(i,a,b) for(int i=a; i<=b; i++)

typedef long long ll;

const int N = 3e5+10;

struct pack
{
    ll x, id;

    bool operator < (pack A) const
    {
        return x < A.x;
    }
} a[N];

int n, k, start;
ll num, t[N], d;

ll sum(int l, int r)
{
    return t[r] - t[l-1];
}

int main()
{
    fastio;
    cin >> n;
    fu(i, 1, n)
    {
        cin >> a[i].x;
        a[i].id = i;
    }
    sort(a+1, a+1+n);
    cin >> k;
    fu(i, 1, n) t[i] = t[i-1] + a[i].x;
    fu(i, 1, k) d += a[i].x*i - sum(1, i-1);
    num = d;
    start = 1;
    fu(i, 2, n-k+1)
    {
        d -= sum(i, i+k-2);
        d += a[i-1].x*(k-1);
        d += a[i+k-1].x*(k-1);
        d -= sum(i, i+k-2);
        if (d < num)
        {
            num = d;
            start = i;
        }
    }
    fu(i, start, start+k-1) cout << a[i].id << " ";
    return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fu(i,a,b) for(int i=a; i<=b; i++)

const int N = 3e5+10;

struct pack
{
    int x, id;

    bool operator < (pack A) const
    {
        return x < A.x;
    }
} a[N];

int n, k, num = 1e9, t;

int main()
{
    fastio;
    cin >> n;
    fu(i, 1, n)
    {
        cin >> a[i].x;
        a[i].id = i;
    }
    sort(a+1, a+1+n);
    cin >> k;
    fu(i, k, n)
    if (num > a[i].x - a[i-k+1].x)
    {
        t = i;
        num = a[i].x - a[i-k+1].x;
    }
    fu(i, t-k+1, t) cout << a[i].id << " ";
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fu(i,a,b) for(int i=a; i<=b; i++)

typedef long long ll;

const int N = 3e5+10;

struct pack
{
    int x, id;

    bool operator < (pack A) const
    {
        return x < A.x;
    }
} a[N];

int n, k, start;
ll num, t[N], d;

ll sum(int l, int r)
{
    return t[r] - t[l-1];
}

int main()
{
    fastio;
    cin >> n;
    fu(i, 1, n)
    {
        cin >> a[i].x;
        a[i].id = i;
    }
    sort(a+1, a+1+n);
    cin >> k;
    fu(i, 1, n) t[i] = t[i-1] + a[i].x;
    fu(i, 1, k) d += a[i].x*i - sum(0, i-1);
    num = d;
    start = 1;
    fu(i, 2, n-k+1)
    {
        ll p = d;
        p -= sum(i, i+k-2);
        p += a[i-1].x*(k-1);
        p += a[i+k-1].x*(k-1);
        p -= sum(i, i+k-2);
        if (p < d)
        {
            d = p;
            start = i;
        }
    }
    fu(i, start, start+k-1) cout << a[i].id << " ";
    return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fu(i,a,b) for(int i=a; i<=b; i++)

const int N = 3e5+10;

struct pack
{
    int x, id;

    bool operator < (pack A) const
    {
        return x < A.x;
    }
} a[N];

int n, k, num = 1e9, t;

int main()
{
    fastio;
    cin >> n;
    fu(i, 1, n)
    {
        cin >> a[i].x;
        a[i].id = i;
    }
    sort(a+1, a+1+n);
    cin >> k;
    fu(i, k, n)
    if (num > a[i].x - a[i-k+1].x)
    {
        t = i;
        num = a[i].x - a[i-k+1].x;
    }
    fu(i, t-k+1, t) cout << a[i].id << " ";
    cout << "\n" << res;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int nmax=3e5+42;
int n,k;
pair<int/*value*/,int/*index*/> inp[nmax];
int main()
{
scanf("%i",&n);
for(int i=1;i<=n;i++)
{
    scanf("%i",&inp[i].first);
    inp[i].second=i;
}
scanf("%i",&k);
sort(inp+1,inp+n+1);
long long ans=0,sum=0,ind=1;
for(int i=1;i<=k;i++)
{
    sum=sum+inp[i].first;
    ans=ans+1LL*i*inp[i].first-sum;
}
//cout<<1<<" "<<ans<<endl;
long long now=ans;
for(int i=2;i+k-1<=n;i++)
{
    now=now-(sum-1LL*k*inp[i-1].first);
    sum=sum-inp[i-1].first+inp[i+k-1].first;
    now=now+(1LL*k*inp[i+k-1].first-sum);
    if(now<ans)
    {
        ans=now;
        ind=i;
    }
    //cout<<i<<" "<<now<<" "<<sum<<endl;
}
for(int i=ind;i<ind+k;i++)
    printf("%i ",inp[i].second);
printf("\n");
return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int nmax=3e5+42;
int n,k;
pair<int/*value*/,int/*index*/> inp[nmax];
int main()
{
scanf("%i",&n);
for(int i=1;i<=n;i++)
{
    scanf("%i",&inp[i].first);
    inp[i].second=i;
}
scanf("%i",&k);
sort(inp+1,inp+n+1);
long long ans=0,sum=0,ind=1;
for(int i=1;i<=k;i++)
{
    ans=ans+1LL*(i-1)*inp[i].first-sum;
    sum=sum+inp[i].first;
}
long long now=ans;
for(int i=2;i+k-1<=n;i++)
{
    now=now-(sum-1LL*i*inp[i-1].first);
    sum=sum-inp[i-1].first+inp[i+k-1].first;
    now=now+(1LL*i*inp[i+k-1].first-sum);
    if(now<ans)
    {
        ans=now;
        ind=i;
    }
}
for(int i=ind;i<ind+k;i++)
    printf("%i ",inp[i].second);
printf("\n");
return 0;
}


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

typedef long long ll;
typedef long unsigned long ull;
typedef double long ld;

struct stanica {
	int x, id;

	template<class T>
	auto operator< (const T& b) const {
		return x < b.x;
	}
};

int n, k;
stanica a[300005];
ull d[300005];
ull z[600005];

void dod(ull c, ull e) {
	for (int i=0; i<n-1; i++)
		z[i+e] += c * d[i];
}

int main() {
	ios::sync_with_stdio(!cin.tie(0));

	cin >> n;
	for (int i=0; i<n; i++)
		cin >> a[i].x, a[i].id = i+1;

	cin >> k;

	for (int i=0; i<n-1; i++)
		d[i] = a[i+1].x - a[i].x;

	dod(k-1, 0);
	dod(-1-k, 1);
	dod(k+1, k);
	dod(1-k, k+1);

	// triput ps
	for (int i=0; i<3; i++) {
		for (int j=1; j<600005; j++) {
			z[j] += z[j-1];
		}
	}

	ull u = ~0;
	int s = 0;

	for (int i=k-2; i<n-1; i++) {
		if (z[i] < u) {
			u = z[i];
			s = i-k+2;
		}
	}

	for (int j=s; j<s+k; j++) {
		cout << a[j].id << " \n"[j == s+k-1];
	}
}


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

typedef long long ll;
typedef long unsigned long ull;
typedef double long ld;

struct stanica {
	int x, id;

	template<class T>
	auto operator< (const T& b) const {
		return x < b.x;
	}
};

int n, k;
stanica a[300005];
ull d[300005];
ull z[600005];

void dod(ull c, ull e) {
	for (int i=0; i<n-1; i++)
		z[i+e] += c * d[i];
}

int main() {
	ios::sync_with_stdio(!cin.tie(0));

	cin >> n;
	for (int i=0; i<n; i++)
		cin >> a[i].x, a[i].id = i+1;

	sort(a, a+n);

	cin >> k;

	for (int i=0; i<n-1; i++)
		d[i] = a[i+1].x - a[i].x;

	dod(k-1, 0);
	dod(-1-k, 1);
	dod(k+1, k);
	dod(1-k, k+1);

	// triput ps
	for (int i=0; i<3; i++) {
		for (int j=1; j<600005; j++) {
			z[j] += z[j-1];
		}
	}

	ull u = ~0;
	int s = 0;

	for (int i=k-2; i<n-1; i++) {
		if (z[i] < u) {
			u = z[i];
			s = i-k+2;
		}
	}

	for (int j=s; j<s+k; j++) {
		cout << a[j].id << " \n"[j == s+k-1];
	}
}


#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
using namespace std;

#define N  100005

void solve()
{
	int n;
	cin>>n;
	ll a[n];
	map<ll,ll> mx;
	rep(i,0,n){
		cin>>a[i];
		mx[a[i]]=i+1;
	}
	sort(a,a+n);
	int k;
	cin>>k;
	ll pre[n+5]={0};
	rep(i,0,n)
		pre[i+1]=pre[i]+a[i];
	ll sl=0;
	rep(i,1,k){
		sl+=i*a[i]-pre[i];
	}
	ll ans=sl,st=0;
	rep(i,k,n){
		sl-=pre[i]-pre[i-k+1]-(k-1)*a[i-k];
		sl+=(k-1)*a[i]-(pre[i]-pre[i-k+1]);
		if(sl<ans){
			ans=sl;
			st=i-k+1;
		}
	}
	vector<int> anss;
	rep(i,0,k){
		anss.pb(mx[a[st+i]]);
	}
	rep(i,0,k)
		cout<<anss[i]<<" ";
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int TESTS=1;
//	cin>>TESTS;
	while(TESTS--)
	{
		solve();
	}
	return 0;
}


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

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair < int , pii > piii;
typedef pair<double, int > pdi;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef pair < ll , pll > plll;
typedef pair < pll , pll > pllll;

#define all(v) (v).begin(), (v).end()
#define KeepUnique(v) (v).erase( unique(all(v)), v.end() )
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define endl '\n'
#define mx 100005
#define mx1 100005
#define mx2 200005
#define mx3 300005
#define WHITE 0
#define RED 1
#define BLACK 2

#define bp __builtin_popcountll
#define fraction() cout.unsetf(ios::floatfield); cout.precision(14); cout.setf(ios::fixed,ios::floatfield);
#define hi cout<<"Dhukse " << endl;
#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)

const double PI = acos(-1);
const double eps = 1e-12;
const int inf = 2000000000;
const ll infLL = (ll)2e18;
ll MOD = 1000000007;
int MOD1 = 1000000007;
int MOD2 = 1000000009;
#define harmonic(n) 0.57721566490153286l(Eulers-Mascharoni constant)+log(n) ( 1/1 + 1/2 + .... + 1/n );

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) ((a) * (a))
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

inline bool checkBit(ll n, ll i) { return n&(1LL<<i); }
inline ll setBit(ll n, ll i) { return n|(1LL<<i);; }
inline ll resetBit(ll n, ll i) { return n&(~(1LL<<i)); }
#define bp __builtin_popcount

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }
inline bool isLeapYear(ll year) { return (year%400==0) || (year%4==0 && year%100!=0); }
inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1LL; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1LL; } return r; }
inline ll modDiv(ll a, ll b) { return modMul(a, modPow(b, MOD-2)); }

bool comp( const pair < ll , pll > &p1 , const pair < ll , pll > &p2 ){ return p1.F > p2.F ;}
bool comp1( const pll &p1 , const pll &p2 ){
          if( p1.F == p2.F ){
                 return p1.S > p2.S;
          }
          return p1.F < p2.F ;
}
ll converter( string a ){
    ll i , mul = 1 , r , t ,ans = 0LL;if( a.length() == 0 )return 0;for( i = a.length() - 1 ; i >= 0 ; i-- ){
        t = a[i] - '0';r = t%10;ans += (mul*r);mul = mul*10;
    }
    return ans;
}
int msb(unsigned x) {
	union { double a; int b[2]; };
	a = x;
	return (b[1] >> 20) - 1023;
}

//
//debug
#ifdef RIP
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename T >
ostream &operator << ( ostream & os, const multiset< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}
#else
#define dbg(args...)
#endif  //RIP
const int MAX=  300005;
ll dp1[MAX] ;
pair < ll , ll > a[MAX];
vector < pll > store;
unsigned long long int sum[MAX];
int main() {
    optimize();
    //fraction();
    //freopen("input.txt","r",stdin);
   int n , i , x ,k;
   cin >> n ;
   unsigned long long int mini = (unsigned long long int )1.5e19;
   ll idx ;
   for(i = 1 ; i <= n; ++i) {
        cin >>a[i].F;
        a[i].S = i;
        sum[i] = sum[i-1] + a[i].F;
   }
   cin >> k;

   sort(a + 1 , a + n + 1);
   a[0].F = a[1].F;
   a[n+1].F = a[n].F;
   int ptr = 1;
   for( i = 1 ; i <= n; ++i ){
         if( i >= k ){
           dp1[i] = dp1[i-1] + (a[i].F*(k)) - ( sum[i] - sum[i-k] );
         }
         else dp1[i] = dp1[i-1] + ( a[i].F*i) - sum[i];
         if( i >= k  ){
            if( mini > dp1[i] ) mini = dp1[i] , idx = i;
            dbg( i ,dp1[i] );
            ll cur = ( sum[i] - sum[ptr] ) - (a[ptr].F )*(k-1);
            dp1[i] -= cur;
            ++ptr;
         }
   }
   for(i = idx ; i > idx - k ; --i )cout << a[i].S << " ";

    return 0;

}


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

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair < int , pii > piii;
typedef pair<double, int > pdi;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef pair < ll , pll > plll;
typedef pair < pll , pll > pllll;

#define all(v) (v).begin(), (v).end()
#define KeepUnique(v) (v).erase( unique(all(v)), v.end() )
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define endl '\n'
#define mx 100005
#define mx1 100005
#define mx2 200005
#define mx3 300005
#define WHITE 0
#define RED 1
#define BLACK 2

#define bp __builtin_popcountll
#define fraction() cout.unsetf(ios::floatfield); cout.precision(14); cout.setf(ios::fixed,ios::floatfield);
#define hi cout<<"Dhukse " << endl;
#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)

const double PI = acos(-1);
const double eps = 1e-12;
const int inf = 2000000000;
const ll infLL = (ll)2e18;
ll MOD = 1000000007;
int MOD1 = 1000000007;
int MOD2 = 1000000009;
#define harmonic(n) 0.57721566490153286l(Eulers-Mascharoni constant)+log(n) ( 1/1 + 1/2 + .... + 1/n );

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) ((a) * (a))
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

inline bool checkBit(ll n, ll i) { return n&(1LL<<i); }
inline ll setBit(ll n, ll i) { return n|(1LL<<i);; }
inline ll resetBit(ll n, ll i) { return n&(~(1LL<<i)); }
#define bp __builtin_popcount

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }
inline bool isLeapYear(ll year) { return (year%400==0) || (year%4==0 && year%100!=0); }
inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1LL; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1LL; } return r; }
inline ll modDiv(ll a, ll b) { return modMul(a, modPow(b, MOD-2)); }

bool comp( const pair < ll , pll > &p1 , const pair < ll , pll > &p2 ){ return p1.F > p2.F ;}
bool comp1( const pll &p1 , const pll &p2 ){
          if( p1.F == p2.F ){
                 return p1.S > p2.S;
          }
          return p1.F < p2.F ;
}
ll converter( string a ){
    ll i , mul = 1 , r , t ,ans = 0LL;if( a.length() == 0 )return 0;for( i = a.length() - 1 ; i >= 0 ; i-- ){
        t = a[i] - '0';r = t%10;ans += (mul*r);mul = mul*10;
    }
    return ans;
}
int msb(unsigned x) {
	union { double a; int b[2]; };
	a = x;
	return (b[1] >> 20) - 1023;
}

//
//debug
#ifdef RIP
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename T >
ostream &operator << ( ostream & os, const multiset< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}
#else
#define dbg(args...)
#endif  //RIP

const int MAX=  300005;
ll dp1[MAX] , dp2[MAX] ;
pair < ll , ll > a[MAX];
vector < pll > store;
int main() {
    optimize();
    //fraction();
    //freopen("input.txt","r",stdin);
   int n , i , x ,k;
   cin >> n ;
   for(i = 1 ; i <= n; ++i) {
        cin >>a[i].F;
        a[i].S = i;
   }
   cin >> k;

   sort(a + 1 , a + n + 1);
   a[0].F = a[1].F;
   a[n+1].F = a[n].F;

   for( i = 1 ; i <= n; ++i ){
         dp1[i] = dp1[i-1] + (a[i].F - a[i-1].F)*(i-1);
   }
   for( i = n ; i >= 1 ; --i ){
         dp2[i] = dp2[i+1] + ( a[i+1].F - a[i].F)*(n-i);
   }
   for( i = 1 ; i<= n; ++i){
    store.PB(pll(dp1[i] + dp2[i] , a[i].S ));
   }
   sort(all(store));

   for(i = 0 ; i < k; ++i){
    cout << store[i].S << " " ;
   }

    return 0;

}


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

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair < int , pii > piii;
typedef pair<double, int > pdi;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef pair < ll , pll > plll;
typedef pair < pll , pll > pllll;

#define all(v) (v).begin(), (v).end()
#define KeepUnique(v) (v).erase( unique(all(v)), v.end() )
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define endl '\n'
#define mx 100005
#define mx1 100005
#define mx2 200005
#define mx3 300005
#define WHITE 0
#define RED 1
#define BLACK 2

#define bp __builtin_popcountll
#define fraction() cout.unsetf(ios::floatfield); cout.precision(14); cout.setf(ios::fixed,ios::floatfield);
#define hi cout<<"Dhukse " << endl;
#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)

const double PI = acos(-1);
const double eps = 1e-12;
const int inf = 2000000000;
const ll infLL = (ll)2e18;
ll MOD = 1000000007;
int MOD1 = 1000000007;
int MOD2 = 1000000009;
#define harmonic(n) 0.57721566490153286l(Eulers-Mascharoni constant)+log(n) ( 1/1 + 1/2 + .... + 1/n );

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) ((a) * (a))
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

inline bool checkBit(ll n, ll i) { return n&(1LL<<i); }
inline ll setBit(ll n, ll i) { return n|(1LL<<i);; }
inline ll resetBit(ll n, ll i) { return n&(~(1LL<<i)); }
#define bp __builtin_popcount

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }
inline bool isLeapYear(ll year) { return (year%400==0) || (year%4==0 && year%100!=0); }
inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1LL; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1LL; } return r; }
inline ll modDiv(ll a, ll b) { return modMul(a, modPow(b, MOD-2)); }

bool comp( const pair < ll , pll > &p1 , const pair < ll , pll > &p2 ){ return p1.F > p2.F ;}
bool comp1( const pll &p1 , const pll &p2 ){
          if( p1.F == p2.F ){
                 return p1.S > p2.S;
          }
          return p1.F < p2.F ;
}
ll converter( string a ){
    ll i , mul = 1 , r , t ,ans = 0LL;if( a.length() == 0 )return 0;for( i = a.length() - 1 ; i >= 0 ; i-- ){
        t = a[i] - '0';r = t%10;ans += (mul*r);mul = mul*10;
    }
    return ans;
}
int msb(unsigned x) {
	union { double a; int b[2]; };
	a = x;
	return (b[1] >> 20) - 1023;
}

//
//debug
#ifdef RIP
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename T >
ostream &operator << ( ostream & os, const multiset< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}
#else
#define dbg(args...)
#endif  //RIP
const int MAX=  300005;
ll dp1[MAX] ;
pair < ll , ll > a[MAX];
vector < pll > store;
unsigned long long int sum[MAX];
int main() {
    optimize();
    //fraction();
   // freopen("input.txt","r",stdin);
   int n , i , x ,k;
   cin >> n ;
   unsigned long long int mini = (unsigned long long int )1.5e19;
   ll idx ;
   for(i = 1 ; i <= n; ++i) {
        cin >>a[i].F;
        a[i].S = i;
        sum[i] = sum[i-1] + a[i].F;
   }
   cin >> k;

   sort(a + 1 , a + n + 1);
   a[0].F = a[1].F;
   a[n+1].F = a[n].F;
   int ptr = 1;
   for( i = 1 ; i <= n; ++i ){
         dp1[i] = dp1[i-1] + (a[i].F - a[i-1].F)*(k-1);
         if( i >= k  ){
            if( mini > dp1[i] ) mini = dp1[i] , idx = i;
            ll cur = ( sum[i] - sum[ptr] ) - (a[ptr].F )*(k-1);
            dp1[i] -= cur;
            ++ptr;
         }
   }
   for(i = idx ; i > idx - k ; --i )cout << a[i].S << " ";

    return 0;

}


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

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair < int , pii > piii;
typedef pair<double, int > pdi;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef pair < ll , pll > plll;
typedef pair < pll , pll > pllll;

#define all(v) (v).begin(), (v).end()
#define KeepUnique(v) (v).erase( unique(all(v)), v.end() )
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define endl '\n'
#define mx 100005
#define mx1 100005
#define mx2 200005
#define mx3 300005
#define WHITE 0
#define RED 1
#define BLACK 2

#define bp __builtin_popcountll
#define fraction() cout.unsetf(ios::floatfield); cout.precision(14); cout.setf(ios::fixed,ios::floatfield);
#define hi cout<<"Dhukse " << endl;
#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)

const double PI = acos(-1);
const double eps = 1e-12;
const int inf = 2000000000;
const ll infLL = (ll)2e18;
ll MOD = 1000000007;
int MOD1 = 1000000007;
int MOD2 = 1000000009;
#define harmonic(n) 0.57721566490153286l(Eulers-Mascharoni constant)+log(n) ( 1/1 + 1/2 + .... + 1/n );

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) ((a) * (a))
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

inline bool checkBit(ll n, ll i) { return n&(1LL<<i); }
inline ll setBit(ll n, ll i) { return n|(1LL<<i);; }
inline ll resetBit(ll n, ll i) { return n&(~(1LL<<i)); }
#define bp __builtin_popcount

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }
inline bool isLeapYear(ll year) { return (year%400==0) || (year%4==0 && year%100!=0); }
inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1LL; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1LL; } return r; }
inline ll modDiv(ll a, ll b) { return modMul(a, modPow(b, MOD-2)); }

bool comp( const pair < ll , pll > &p1 , const pair < ll , pll > &p2 ){ return p1.F > p2.F ;}
bool comp1( const pll &p1 , const pll &p2 ){
          if( p1.F == p2.F ){
                 return p1.S > p2.S;
          }
          return p1.F < p2.F ;
}
ll converter( string a ){
    ll i , mul = 1 , r , t ,ans = 0LL;if( a.length() == 0 )return 0;for( i = a.length() - 1 ; i >= 0 ; i-- ){
        t = a[i] - '0';r = t%10;ans += (mul*r);mul = mul*10;
    }
    return ans;
}
int msb(unsigned x) {
	union { double a; int b[2]; };
	a = x;
	return (b[1] >> 20) - 1023;
}

//
//debug
#ifdef RIP
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename T >
ostream &operator << ( ostream & os, const multiset< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}
#else
#define dbg(args...)
#endif  //RIP
const int MAX=  300005;
ll dp1[MAX] ;
pair < ll , ll > a[MAX];
vector < pll > store;
long long int sum[MAX];
int main() {
    optimize();
    //fraction();
    //freopen("input.txt","r",stdin);
   int n , i , x ,k;
   cin >> n ;
   ll mini = infLL;
   ll idx ;
   for(i = 1 ; i <= n; ++i) {
        cin >>a[i].F;
        a[i].S = i;
   }
   cin >> k;

   sort(a + 1 , a + n + 1);

   for(i= 1 ; i <= n; ++i) {
        sum[i] = sum[i-1] + a[i].F;
   }

   a[0].F = a[1].F;
   a[n+1].F = a[n].F;
   for( i = 1 ; i <= n; ++i ){
         if( i >= k ){
           dp1[i] = dp1[i-1] + (a[i].F*(k)) - ( sum[i] - sum[i-k] );
         }
         else dp1[i] = dp1[i-1] + ( a[i].F*i) - sum[i];
         if( i >= k  ){
            if( mini > dp1[i] ) mini = dp1[i] , idx = i;
            ll cur = ( sum[i] - sum[i-k+1] ) - (a[i-k+1].F )*(k-1);
            dp1[i] -= cur;
         }
   }
   for(i = idx ; i > idx - k ; --i )cout << a[i].S << " ";

    return 0;

}


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

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair < int , pii > piii;
typedef pair<double, int > pdi;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef pair < ll , pll > plll;
typedef pair < pll , pll > pllll;

#define all(v) (v).begin(), (v).end()
#define KeepUnique(v) (v).erase( unique(all(v)), v.end() )
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define endl '\n'
#define mx 100005
#define mx1 100005
#define mx2 200005
#define mx3 300005
#define WHITE 0
#define RED 1
#define BLACK 2

#define bp __builtin_popcountll
#define fraction() cout.unsetf(ios::floatfield); cout.precision(14); cout.setf(ios::fixed,ios::floatfield);
#define hi cout<<"Dhukse " << endl;
#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)

const double PI = acos(-1);
const double eps = 1e-12;
const int inf = 2000000000;
const ll infLL = (ll)2e18;
ll MOD = 1000000007;
int MOD1 = 1000000007;
int MOD2 = 1000000009;
#define harmonic(n) 0.57721566490153286l(Eulers-Mascharoni constant)+log(n) ( 1/1 + 1/2 + .... + 1/n );

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) ((a) * (a))
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

inline bool checkBit(ll n, ll i) { return n&(1LL<<i); }
inline ll setBit(ll n, ll i) { return n|(1LL<<i);; }
inline ll resetBit(ll n, ll i) { return n&(~(1LL<<i)); }
#define bp __builtin_popcount

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }
inline bool isLeapYear(ll year) { return (year%400==0) || (year%4==0 && year%100!=0); }
inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1LL; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1LL; } return r; }
inline ll modDiv(ll a, ll b) { return modMul(a, modPow(b, MOD-2)); }

bool comp( const pair < ll , pll > &p1 , const pair < ll , pll > &p2 ){ return p1.F > p2.F ;}
bool comp1( const pll &p1 , const pll &p2 ){
          if( p1.F == p2.F ){
                 return p1.S > p2.S;
          }
          return p1.F < p2.F ;
}
ll converter( string a ){
    ll i , mul = 1 , r , t ,ans = 0LL;if( a.length() == 0 )return 0;for( i = a.length() - 1 ; i >= 0 ; i-- ){
        t = a[i] - '0';r = t%10;ans += (mul*r);mul = mul*10;
    }
    return ans;
}
int msb(unsigned x) {
	union { double a; int b[2]; };
	a = x;
	return (b[1] >> 20) - 1023;
}

//
//debug
#ifdef RIP
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename T >
ostream &operator << ( ostream & os, const multiset< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}
#else
#define dbg(args...)
#endif  //RIP
const int MAX=  300005;
ll dp1[MAX] ;
pair < ll , ll > a[MAX];
vector < pll > store;
ll sum[MAX];
int main() {
    optimize();
    //fraction();
    //freopen("input.txt","r",stdin);
   ll n , i , x ,k;
   cin >> n ;
   ll mini = infLL;
   ll idx ;
   for(i = 1 ; i <= n; ++i) {
        cin >>a[i].F;
        a[i].S = i;
   }
   cin >> k;

   sort(a + 1 , a + n + 1);

   for(i= 1 ; i <= n; ++i) {
        sum[i] = sum[i-1] + a[i].F;
   }

   a[0].F = a[1].F;
   a[n+1].F = a[n].F;
   for( i = 1 ; i <= n; ++i ){
         if( i >= k ){
           dp1[i] = dp1[i-1] + (a[i].F*(k)) - ( sum[i] - sum[i-k] );
         }
         else dp1[i] = dp1[i-1] + ( a[i].F*i) - sum[i];
         if( i >= k  ){
            if( mini > dp1[i] ) mini = dp1[i] , idx = i;
            ll cur = ( sum[i] - sum[i-k+1] ) - (a[i-k+1].F )*(k-1);
            dp1[i] -= cur;
         }
   }
   for(i = idx ; i > idx - k ; --i )cout << a[i].S << " ";

    return 0;

}