#include    <bits/stdc++.h>

using namespace std;

long long n,k,a[1000000];

void    doc(){

   // freopen("ABSMIN.INP","r",stdin);

   // freopen("ABSMIN.OUT","w",stdout);

    cin >> n >> k;

    for(int i=1; i<=n; i++) cin >> a[i];

}

void    xuly(){

    for(int i=1; i<=k; i++){

        cout << a[i] << " ";

    }

}

int main(){

    doc();

    xuly();

}