#include #include #include #include #include #include #include #include using namespace std; typedef unsigned long long ULL; int n; int f[30]; string s; int len; struct Node { ULL x; int id; }a[1000005]; int ans[1000005]; bool cmp(Node a,Node b) { if (a.x!=b.x) return a.x>s; memset(f,0,sizeof(f)); len=s.size(); for (int i=0;i