/*
" وَكَانَ فَضْلُ اللَّهِ عَلَيْكَ عَظِيمًا "
╔░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╗
║ ║
║ ███╗ ███╗ ██████╗ ██╗ ██╗ █████╗ ███╗ ███╗ ███████╗ ██████╗ ║
║ ████╗ ████║██╔═══██╗██║ ██║ ██╔══██╗ ████╗ ████║ ██╔════╝ ██╔══██╗ ║
║ ██╔████╔██║██║ ██║███████║ ███████║ ██╔████╔██║ █████╗ ██║ ██║ ║
║ ██║╚██╔╝██║██║ ██║██╔══██║ ██╔══██║ ██║╚██╔╝██║ ██╔══╝ ██║ ██║ ║
║ ██║ ╚═╝ ██║╚██████╔╝██║ ██║ ██║ ██║ ██║ ╚═╝ ██║ ███████╗ ██████╔╝ ║
║ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚═════╝ ║
║ ║
║ ██╗ ██╗ ██████╗ ███████╗ ███████╗ █████╗ ███╗ ███╗ ║
║ ██║ ██║ ██╔═══██╗ ██╔════╝ ██╔════╝ ██╔══██╗ ████╗ ████║ ║
║ ███████║ ██║ ██║ ███████╗ ███████╗ ███████║ ██╔████╔██║ ║
║ ██╔══██║ ██║ ██║ ╚════██║ ╚════██║ ██╔══██║ ██║╚██╔╝██║ ║
║ ██║ ██║ ╚██████╔╝ ███████║ ███████║ ██║ ██║ ██║ ╚═╝ ██║ ║
║ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ║
║ ║
╚░░░░░░░░░░░░░░░░░░░░░░░ MOHAMED HOSSAM | SOFTWARE ENGINEER ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╝
*/
#include"bits/stdc++.h"
using namespace std;
#define el '\n'
#define ll long long
#define int long long
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define all(x) (x).begin(), (x).end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) ((int)(x).size())
template<class T, class U>
T GCD(T a, U b) { return (!b ? a : GCD(b, a % b)); }
template<class T, class U>
T LCM(T a, U b) { return ((a / GCD(a, b)) * b); }
template<class Ta, class Tb>
bool chmax(Ta &a, Tb b) {
if (a >= b) return false;
a = b;
return true;
}
template<class Ta, class Tb>
bool chmin(Ta &a, Tb b) {
if (a <= b) return false;
a = b;
return true;
}
constexpr ll MAX = 300000, MOD = 998244353, MAXN = 2e5 + 10, inf = 1e18;
using vi = vector<int>;
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, -1, 1};
inline void free_palestine() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("inputs.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
template<typename T>
istream &operator>>(istream &in, vector<T> &v) {
for (auto &x: v) in >> x;
return in;
}
template<typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
for (const auto &x: v) out << x << ' ';
return out;
}
int cal(int n) {
return n * (n + 1) / 2;
}
void solve(int tc) {
int n;cin>>n;
n = abs(n);
if (n==0) {
cout<<0<<el;
return;
}
int need = 1;
while (cal(need) < n) {
//cout<<need<<endl;
need++;
}
cout<<need<<el;
}
int32_t main() {
free_palestine();
// freopen("collectingofficer.in", "r", stdin);// freopen("palindrome.out", "w", stdout);
int tc = 1;
cin >> tc;
for (int i = 1; i <= tc; ++i) {
solve(i);
}
/*
⢸⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⡷⠀⠀
⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠢⣀⠀⠀
⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇ Did you get accepted, son?
⢸⠀⠀⠀⠀ ⠖⠒⠒⠒⢤⠀⠀⠀⠀⠀⡇⠀⠀
⢸⠀⠀⣀⢤⣼⣀⡠⠤⠤⠼⠤⡄⠀⠀⡇⠀
⢸⠀⠀⠑⡤⠤⡒⠒⠒⡊⠙⡏⠀⢀⠀⡇⠀
⢸⠀⠀⠀⠇⠀⣀⣀⣀⣀⢀⠧⠟⠁ ⡇
⢸⠀⠀⠀⠸⣀⠀⠀⠈⢉⠟⠓⠀⠀⠀⢀⡇⠀⠀
⢸⠀⠀⠀⠀⠈⢱⡖⠋⠁⠀⠀⠀⠀⠀⡇⠀⡇
⢸⠀⠀⠀⠀⣠⢺⠧⢄⣀⠀⠀⣀⣀⠀⡇⠀⡇
⢸⠀⠀⠀⣠⠃⢸⠀⠀⠈⠉⡽⠿⠯⡆⡇
⢸⠀⠀⣰⠁⠀⢸⠀⠀⠀⠀⠉⠉⠉⠀⡇⠀⡇
⢸⠀⠀⠣⠀⠀⢸⢄⠀⠀⠀⠀⠀⠀⠀⡇⠀⡇⠀
⢸⠀⠀⠀⠀⠀⢸⠀⢇⠀⠀⠀⠀⠀⠀⡇⠀⡇
⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉
*/
}