var n,m:integer; a:array[1..10000] of boolean; i,j:integer;begin readln(n,m); for i:=1 to n do a[i]:=true; for j:=1 to m do for i:=1 to n do if i mod j=0 then a[i]:=not a[i]; for i:=1 to n do if a[i] then write(i:4); writeln;end.