#include <stdio.h>
#define MAX 1000000

int main(void){
  int num[2][MAX], p_num[MAX];
  int a, d, n;
  int i, j;

  while(1){
    scanf("%d %d %d", &a, &d, &n);
    
    if((a>9307 || d>346 || n>210) || (a==0 && d==0 && n==0))
      break;

    for(i=0;i<MAX;i++){		     
      num[0][i]=a+d*i;//??????????????°??????????´?
      num[1][i]=0;//2?????????????´???°????????°???????´??????????
    }

    for(i=0;i<MAX;i++){
      for(j=1;j<=num[0][i];j++){
	if(num[0][i]%j==0)
	  num[1][i]++;//???????????????????´???°????????°????????????????????????
      }
    }

    i=0;
    for(j=0;j<MAX;j++){
      if(num[0][j]==2){//?´???°?????°???2?????¨?????????????´???°??§???????????¨
	p_num[i]=num[0][j];//?´???°???p_num???????´?
	i++;
      }
    }

    printf("%d\n", p_num[n]);
  }

  return 0;
}