def fact(x):
ans=1
for i in range(2,x+1):
ans*=i
return ans
def Main():
t=int(input())
j=1
while t>0:
t-=1
s=input()
n=len(s)
val=fact(n)
a=[0]*26
for i in s:
a[ord(i)-ord('A')]+=1
for i in range(0,26):
val//=fact(a[i])
print("Data set %d: %d"%(j,val))
j+=1
if __name__=='__main__':
Main()
ans=1
for i in range(2,x+1):
ans*=i
return ans
def Main():
t=int(input())
j=1
while t>0:
t-=1
s=input()
n=len(s)
val=fact(n)
a=[0]*26
for i in s:
a[ord(i)-ord('A')]+=1
for i in range(0,26):
val//=fact(a[i])
print("Data set %d: %d"%(j,val))
j+=1
if __name__=='__main__':
Main()
Comments
Post a Comment