#include <bits/stdc++.h>
using namespace std;
void print(int a[], int b)
{
for (int i = 1; i <= b; i ++ )
{
cout << a[i] << ' ';
}
}
int main()
{
int n, num, a[1010];
cin >> n >> num;
for (int i = 1; i <= n; i ++ )
{
cin >> a[i];
}
print(a, num);
}