#include 
#include
#include
#include
using namespace std;int n,k,m;int main(){while(scanf("%d %d %d",&n,&k,&m),n||m||k){int ansp,ansn;ansp = 0;for(int i = 1; i < n; i++){ansn = (ansp + k)%i;ansp = ansn;}ansn = (ansp+m)%n + 1;printf("%d\n",ansn);}return 0;}