#include using namespace std; int main() { int N; cin >> N; for( int i = 0; i < N; i++ ) { string S; cin >> S; int sz = S.size(); int z = 0; for( int j = 0; j < sz; j++ ) { if( S[j] != '0' ) break; z++; } if( z == sz ) cout << 0 << endl; else cout << S.substr( z, sz - z ) << endl; } }