#include <stdio.h>
int main()
{
int m,n;
int len,a;
while(scanf("%d%d",&n,&m)!=EOF&&(m||n))
{
len=sqrt(2.0*m);
while(len>0)
{
a=m/len+(1-len)/2;
if((a+a+(len-1))*len/2==m)
printf("[%d,%d]\n",a,a+len-1);
len--;
}
printf("\n");
}
return 0;
}