#ifndef LOCAL
#include <bits/stdc++.h>
#define debug(...)
#endif
using namespace std;
#define int long long
#define cinv(v) for (auto &it:v) cin>>it;
#define coutv(v) for (auto &it:v) cout<< it<<' '; cout<<'\n';
void shelby() {
int n;
cin >> n;
multiset<int, greater<> > ms;
for (int i = 1; i <= n; ++i) {
int x;
cin >> x;
ms.insert(x);
}
int cnt = 0, ans = 0;
while (!ms.empty()) {
int x = *ms.begin();
if (x < 0 && cnt >= 2) break;
ans += (cnt % 2 ? -1 : 1) * x;
ms.erase(ms.begin());
cnt++;
debug(ms, ans);
}
cout << ans << '\n';
}
signed main() {
cin.tie(0)->sync_with_stdio(0);
int t = 1;
cin >> t;
for (int _ = 1; _ <= t; ++_) {
// cout << "Case " << _ << ": ";
shelby();
}
}