#include #include #include #include #include using namespace std; namespace MYS { const int MAXN = 10000005; int len; char a[MAXN]; void input() { scanf("%s", a+1); len = strlen(a+1); sort(a+1, a+len+1); } int cnt; int seq[MAXN]; void work() { int last, v; cnt = 0; for(int i=1;i<=len;i++) if(a[i] != '0') { last = i; break; } if(last == len) { puts("Uncertain"); return; } v = a[last]-'0'; for(int i=1;i<=len;i++) { if(i == last) continue; seq[++cnt] = a[i]-'0'; } seq[cnt+1] = 0; seq[1] += v; for(int i=1;i<=len;i++) { seq[i+1] += seq[i]/10; seq[i] %= 10; } if(seq[cnt+1]) putchar(seq[cnt+1]+'0'); for(int i=cnt;i>=1;i--) putchar(seq[i]+'0'); putchar('\n'); } void Main() { int T; scanf("%d", &T); while(T--) { input(); work(); } } } int main() { MYS::Main(); return 0; }