#include<iostream>
#include<cstring>
using namespace std;
int n,k,m,vis[25],t,d,f,a,b;
int main()
{
while(cin>>n>>k>>m)
{
if(n==k&&k==m&&m==0)break;
memset(vis,0,sizeof(vis));
t=0;a=1;b=n;
while(1)
{
d=0;f=0;
while(d<k)
{
if(a>n)a-=n;
if(!vis[a])d++;
a++;
}
while(f<m)
{
if(b<1)b+=n;
if(!vis[b])f++;
b--;
}
vis[a-1]=vis[b+1]=1;
if(a-1==b+1){if(a-1<10)cout<<" ";cout<<" "<<a-1;t++;}
else {if(a-1<10)cout<<" ";cout<<" "<<a-1;if(b+1<10)cout<<" ";cout<<" "<<b+1;t+=2;}
if(t<n)cout<<",";
else {cout<<endl;break;}
}
}
}