#include # include # include using namespace std; int main() { int n; cin >> n; string a[n]; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) { string tmp = a[i]; int str_idx = 0; while (true){ if (tmp[str_idx] == '0') { tmp.replace(str_idx,1,""); str_idx = 0; if (tmp.length() == 1) { a[i] = tmp; break; } }else{ a[i] = tmp; break; } } } for (int i = 0 ; i < n ; i++) { cout << a[i] << endl; } }