#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long A, B, K;
    cin>>A>>B>>K;
    long long br=0;
    while(B-A>1)
    {
        if((A+2)%K!=0)
        {
            A=A+2;
            cout<<A<<endl;
            br++;
        }
        else
        {
            A=A+1;
            cout<<A<<endl;
            br++;
        }
    }
    if(A==B)
    {
        cout<<br<<endl;
    }
    else
    {
        cout<<br+1<<endl;
    }
    return 0;
}
