import java.io.;
import java.util.;
public class Main{
public static void main(String args[]) throws Exception{
int[] a = new int[1010]; //Java数组的定义
Scanner cin = new Scanner(System.in);
var n = cin.nextInt();
var size = cin.nextInt();
for(int i = 0; i < n; i++){
a[i] = cin.nextInt();
}
print(a, size);
}
public static void print(int a[], int size){
for(int i = 0; i < size; i++){
System.out.printf(a[i] + " ");
}
}
}