#include<cstdio>
#include<cmath>
int main()
{
int n,m,i,j;
while(scanf("%d%d",&n,&m))
{
if(n==0||m==0)break;
int len=sqrt((double)(m)*2.0);
while(len)
{
int a=m/len-(len-1)/2;
int b;
if(a*len+(len-1)*len/2==m)
{
printf("[%d,%d]\n",a,a+len-1);
}
len--;
}printf("\n");
}
return 0;
}
#include<cmath>
int main()
{
}