#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>

typedef struct Node
{
	int num;
	struct Node *next;
} Node;

int main()
{
	int n = 8, k = 5, m = 3;
	while (scanf("%d %d %d", &n, &k, &m) && n)
	{
		Node *entry = malloc(sizeof(Node));
		Node *tmpNode = entry;
		for (int i = 1; i < n; i++)
		{
			tmpNode->num = i;
			tmpNode->next = malloc(sizeof(Node));
			tmpNode = tmpNode->next;
		}
		tmpNode->next = entry;
		tmpNode->num = n;
		int countDown = (m - 1) % n;
		Node *prevNode = tmpNode;
		tmpNode = tmpNode->next;
		while (tmpNode->next != tmpNode)
		{
			if (countDown == 0)
			{
				prevNode->next = tmpNode->next;
				free(tmpNode);
				tmpNode = prevNode->next;
				n--;
				countDown = (k - 1) % n;
			}
			else
			{
				prevNode = tmpNode;
				tmpNode = tmpNode->next;
				countDown--;
			}
		}
		printf("%d\n", tmpNode->num);
	}
	return 0;
}
