#include using namespace std; using ll = long long; void solve() { int c4=0,c7=0; string s; cin>>s; for(int i=0; ic7) cout<<"4"<c4) cout<<"7"<> TC; //cin.ignore(); while (TC--) solve(); }