#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
const int maxm=600000;
using namespace std;
bool ispr[600010],p[1010];
int pr[100000],e,s,t,d,list[1010];
void init(){
for(int i=2;i<=maxm;i++){
if(!ispr[i])pr[++e]=i;
for(int j=1;j<=e;j++){
if(i*pr[j]>maxm)break;
ispr[i*pr[j]]=1;
if(i%pr[j]==0)break;
}
}
}
bool pd(int x,int y){
int sum=y;
if(x<2)return true;
for(int i=x-1;i>=x-d+1 && i>=1;i--){
sum+=list[i];
if(!ispr[sum])return false;
}
return true;
}
bool dfs(int x){
if(x>t-s+1){
for(int i=1;i<x-1;i++)printf("%d,",list[i]);
printf("%d\n",list[x-1]);
return true;
}
for(int i=s;i<=t;i++)
if(!p[i] && pd(x,i)){
list[x]=i;p[i]=1;
if(dfs(x+1))return true;
p[i]=0;
}
return false;
}
int main(){
init();
while(1){
memset(p,0,sizeof(p));
scanf("%d%d%d",&s,&t,&d);
if(s+t+d==0)break;
if(dfs(1));
else printf("No anti-prime sequence exists.\n");
}
return 0;
}