MI=lambda:map(int,input().split()) n,k=MI() d=n-1 h=[1] while h[-1]t:k-=t else:return g(d-1,k)if d and c in"ua"else c print(g(d,k))