#include<stdio.h>
#define maxn 1010
#include<string.h>
int main(void)
{
int a[maxn];
memset(a, 0, sizeof(a));//将数组元素全部替换为零
int n, k,i,first=1;
scanf_s("%d %d", &n, &k);
for (int i = 1; i <= k; i++)
for (int j = 1; j <= n; j++)
if (j % i == 0)
a[j] = !a[j];
for(i=1;i<=n;i++)
if (a[i])
{
if (first)
first = 0;//避免第一行空格
else
{
printf(" ");
}
printf("%d", i);
}
return 0;
}