/* 
   AOJ 1275
   And Then There Was One

*/
#include<stdio.h>
#include<stdlib.h>

struct node
{
  int val;
  struct node* next;
};


struct node* make_circle(int n)
{
  struct node* head = malloc(sizeof(struct node*));
  struct node* p;
  int i;

  head->val = 1;
  for(i = 2, p = head; i < n + 1; i++)
    {
      p->next = malloc(sizeof(struct node*));
      p = p->next;
      p->val = i;
    }
  p->next = head;
  return head;
}



int search_ans(struct node* head, int n, int k, int m)
{
  int i, j;
  struct node* p = head;
  struct node* prev = head;
  struct node* d;

  if(m == 1)
    {
      for(i = 0; i < n - 1; i++)
	{
	  prev = prev->next;
	}
    }
  else
    {
      for(i = 0; i < m - 1; i++)
	{
	  prev = p;
	  p = p->next;
	}
    }

  /* printf("p = %d, prev = %d\n", p->val, prev->val); */

  for(i = 0; i < n - 1; i++)
    {
      prev->next = p->next;
      d = p;
      for(j = 0; j < k; j++)
	{
	  prev = p;
	  p = p->next;
	}
      free(d);
      /* printf("p is %d, prev = %d\n", p->val, prev->val); */
    }
  return p->val;
}



int main(void)
{
  int n, k, m, ans;
  struct node* head;
  while(1)
    {
      scanf("%d %d %d", &n, &k, &m);
      if(n == 0 && k == 0 && m == 0)
	{
	  break;
	}

      head = make_circle(n);
      ans = search_ans(head, n, k, m);

      printf("%d\n", ans);
    }
  return 0;
}