N,K=map(int,input().split()) syaku=list(range(1,N+1)) l,r=0,0 tmp=(N*(N+1))//2 for l in range(N): while(True): if tmp==K: print(1) exit() if tmp=N: break tmp-=syaku[r] r+=1 tmp+=syaku[l] print(2)