program STAIRS;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var n,k,a,b,c: longint;
begin
 assign(input,'STAIRS.IN');
 read(n);
 for a:=1 to n do
 begin
 read(k);
 c:=0;
  for b:=1 to k do
 begin
  c:=c+b;

 if (k-c)=b then
 begin
  writeln(b);
   break;
   end;
 if (k-c)<b then
 begin
  writeln(b);
 break;
 end;
 end;

 end;
 
    { TODO -oUser -cConsole Main : Insert code here }
end.
