#include <stdio.h>
int main()
{
	int i, j, k, n, p;
	int d[50];

	while(1)
	{
		for ( i = 0; i < 50; i++)
		{		
			d[i] = 0;
		}

		scanf("%d %d", &n, &p);
		if ( n == 0 && p == 0 ) return 0;
		t = p;
		while(1)
		{
			for ( i = 0; i < n; i++)
			{
				if ( p != 0 )
				{
					d[i] += 1;
					p--;
				}
				else if( p == 0 )
				{
					p = d[i];
				}
				if ( p == 0 && d[i] == t) goto owari;
			}
		}
		for( i = 0; i < n; i++)
		{
			if ( d[i] != 0 )
			{
				printf("%d\n",d[i]);
			}
		}
	}
	return 0;
}