#include #define test cout << "test:" using namespace std; using P = pair; const int inf = 1073741824; const long long linf = 1152921504606846976; // const int mod = 998244353; // const int mod = 1000000007; const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1}; string z(string s) { reverse(s.begin(), s.end()); while (s.back() == '0' and s.size() > 1) s.pop_back(); reverse(s.begin(), s.end()); return s; } void _main() { int n; cin >> n; while (n--) { string s; cin >> s; // test; cout << z(s) << '\n'; } return; } int main() { ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15); _main(); }