program Stairs;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var x,i,y,z:integer;
f:text;
begin
assign(f,'Stairs.in');
reset(f);
y:=0;
i:=0;
read(f,z);
repeat begin
read(f,x);
repeat begin
y:=y+1;
i:=i+y;
end;
until (x<=i);
if x<>i then
writeln(y-1)
else writeln(y);
y:=0;
i:=0;
end;
until eof(f);
  { TODO -oUser -cConsole Main : Insert code here }
end.
