#include #include #include #include #include #include #include #include #define inf 999999999 #define mo 1000000007 #define LL long long using namespace std; char s[10000]; int n,l; string st; map ma; int main() { scanf("%d",&n); for (int i=1;i<=n;i++) { scanf("%s",s); l=strlen(s); sort(s,s+l); st=""; for (int j=0;j