program Project2;
{$APPTYPE CONSOLE}
uses
  SysUtils;

var
  a,b,k: array[1..100] of integer;
  s: string;
  x,i,j: integer;
  f: textfile;
begin
AssignFile(f,'stairs.in');
reset(f);
readln(f,s);
x:=strtoint(s);
for i:=1 to x do begin
  readln(f,s);
  a[i]:=strtoint(s);
  if (a[i]<1) or (a[i]>100000) then abort;
end;
for i:=1 to x do k[i]:=0;
for i:=1 to x do begin
  while a[i]>k[i] do begin
    k[i]:=k[i]+1;
    a[i]:=a[i]-k[i];
  end;
  end;
for i:=1 to x do begin
  b[i]:=k[i];
  s:=inttostr(b[i]);
  writeln(s);
end;
closefile(f);
end.
