#include using namespace std; int main() { int N; cin >> N; for (int i = 0; i < N; i++) { string S; cin >> S; reverse(S.begin(), S.end()); while (S.size() > 1 && S.back() == '0') S.pop_back(); reverse(S.begin(), S.end()); cout << S << endl; } }