program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var ij, ii:integer;
v,l,x:longint;

begin
 assign(input,'WEIGHING.IN'); reset(input);
 readln(ii);
 for ij := 1 to ii do begin
 
readln(v);
x:=1;
l:=0;
while v > x do
begin
  x:= x*3;
  inc(l);
end;
writeln(l);
   end;
end.
