#include<stdio.h>
#include<stdlib.h>
typedef struct LNode{
int data;
struct LNode *next;
}LNode,*LinkList;
LinkList Build(int n)
{
int i;
LinkList head;
head = (LinkList)malloc(sizeof(LNode));
LinkList s,p = head;
p->data = 1;
for(i = 2; i <= n; i ++)
{
s = (LinkList)malloc(sizeof(LNode));
s->data = i;
p->next = s;
p = s;
}
p->next = head;
return head;
}
LinkList GetElem(LinkList p,int n)
{
int i;
LinkList s = p;
for( i = 1; i < n; i ++)
{
s = s->next ;
}
return s;
}
int Delete(LinkList p)
{
int num;
LinkList s;
s = (LinkList)malloc(sizeof(LNode));
s = p->next ;
p->next = s->next ;
num = s->data ;
free(s);
return num;
}
void CountOff(int n,int m,int k,LinkList head)
{
int i,num;
LinkList p = head;
for(i= n; i >= 1; i --)
{
p = GetElem(p,m-1);
num = Delete(p);
if( i <= k)
printf("%d ",num);
p = p->next ;
}
}
int main()
{
int n,m,k;
LinkList head;
while(scanf("%d%d%d",&n,&m,&k)!=EOF)
{
head = Build(n);
CountOff(n,m,k,head);
}
return 0;
}