#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,(n)-1,0)
#define all(v) v.begin(), v.end()
#define endk '\n'
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
const ll mod2 = 998244353;
const ld eps = 1e-10;
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b){if(a>b) a=b;}
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b){if(a<b) a=b;}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n; cin >> n;
  ll ok = 1000000, ng = 0;
  while(abs(ok-ng) > 1) {
    ll mid = (ok+ng)/2;
    ll sum = mid*(mid+1)/2;
    (sum >= n ? ok : ng) = mid;
  }
  cout << ok << endk;
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
int T,n;
char s[1000001];
int read()
{
	int pos=1,num=0;
	char ch=getchar();
	while (!isdigit(ch))
	{
		if (ch=='-') pos=-1;
		ch=getchar();
	}
	while (isdigit(ch))
	{
		num=num*10+(int)(ch-'0');
		ch=getchar();
	}
	return pos*num;
}
void write(int x)
{
	if (x<0)
	{
		putchar('-');
		write(-x);
		return;
	}
	if (x>=10) write(x/10);
	putchar(x%10+'0');
}
void writesp(int x)
{
	write(x);
	putchar(' ');
}
void writeln(int x)
{
	write(x);
	putchar('\n');
}
int main()
{
	T=read();
	while (T--)
	{
		n=read();
		for (int i=1;i<=n;i++)
			write(0);
		for (int i=1;i<=n;i++)
			write(1);
		write(0);
		putchar('\n');
		scanf("%s",&s);
		scanf("%s",&s);
		scanf("%s",&s);
	}
}





























