#include using namespace std; using ll = long long; int main() { int q; cin>>q; for(int i=0;i>s; ll ans=0; if (s.size()==1) {cout<