993 992 991
 100 1 10
 960 935 994
 99 8 99
 60 16 1
 759 10 258
 24 19 9
 196 169 144
 1000 999 1
 945 812 917
 1000 100 10
 500 300 300
 888 777 1000
 2 1 4
 24 12 12
 767 2 514
 2 1 2
 1000 1 1
 5 2 1
 70 32 1
 765 123 899
 17 7 10
 5 4 10
 888 777 888
 66 38 4
 1000 999 1000
 9 3 300
 244 87 4
 765 123 45
 1000 1 1000
 305 203 421
 100 10 1
 64 12 8
 894 1 999
 2 1 1
 18 14 10
 6 2 4
 888 777 1
 27 26 1
 2 1 3
 5 1 5
 7 3 200
 561 31 917
 17 10 7
 93 74 831

1
 990
 27
 1127
 3
 19325
 3
 24
 1
 151
 90
 200
 143
 4
 12
 196605
 2
 999
 2
 2
 4693
 15
 3
 127
 3
 2
 600
 8
 235
 999000
 212
 9
 35
 892107
 1
 3
 8
 1
 1
 3
 20
 267
 15678
 5
 214

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Scanner;


public class p195b {
    static public void main(String[] Args){
        Scanner data = new Scanner(System.in);
        int n,m;
        n=data.nextInt();
        m=data.nextInt();
        int step;
        if(m%2==0)step=1;
        else step=0;
        int[] res = new int[100001];
        Arrays.fill(res,0);
        int i,j;
        i=(m+1)/2;
        if(m%2==0)j=i+1;
        else j = i;
        int key=1;
        int[] v = new int[100001];
        Arrays.fill(v,0);
        for(int k=1;k<=n;k++){
            if(v[i]!=key){
                v[i]=key;
                res[k]=i;
            }
            else if (v[j]!=key){
                v[j]=key;
                res[k]=j;
            }
            else{
                i--;
                j++;
                if(i==0){
                    key++;
                    i=(m+1)/2;
                    if(m%2==0)j=i+1;else j=i;
                }
                v[i]=key;
                res[k]=i;
            }
        }
        for(i=1;i<=n;i++)System.out.println(res[i]);
    }
}
  			    	 		 		 	  	  		