program STAIRS;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var n,k,a,b,c,all: longint;
begin
 assign(input,'STAIRS.IN');
 read(n);
 for a:=1 to n do
 begin
 read(k);
 for b:=1 to k do
 begin
 c:=c+b;
 all:=k-c;
 if all<b then
 begin
  write(b);
 break;
 end;
 end;
 end;

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