#include //cin, cout #include //vector #include //sort,min,max,count #include //string,getline, to_string #include //abs(int) #include //swap, pair #include //deque #include //INT_MAX #include //bitset using namespace std; int main() { int N; cin >> N; string S; bool flg = false; for (int i = 0; i < N; i++) { cin >> S; flg = false; for (int j = 0; j < 5; j++) { if (S[j] != '0') { flg = true; } if (flg) { cout << S[j]; } } if (flg) { cout << endl; } } if (!flg) { cout << 0 << endl; } return 0; }