/*约瑟夫问题的直接模拟*/
#include<stdio.h>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<queue>
#include<algorithm>
#define M 1000
using namespace std;
int cards[M];
int goodc[M];
int main()
{
freopen("3629.txt","r",stdin);
int tail=0,head=0;
int play=0;
int n,k,p;
scanf("%d%d%d",&n,&k,&p);
for(int i=0;i<k;i++)
{
cards[tail++]=i+1;
}
int len=0;
while(head<=tail)
{
if(play==n-1)goodc[len++]=cards[head];
head++;
for(int i=0;i<p;i++)
{
cards[tail++]=cards[head++];
}
play=(play+1)%n;
}
sort(goodc,goodc+k/n);
for(int i=0;i<k/n;i++)
{
printf("%d\n",goodc[i]);
}
}