n=int(input())
for i in range(n):
    d=int(input())
    a=1
    while d>a:
        t=0
        t+=1
        d=d-t
    else:
        a+=1
        if a>=n:
            print(t)
        else:
            
        
    
        
    
    