import hashlib
import os
import itertools
f = open(r'D:\KEY\gesture.key','r')
psd = f.readline()
f.close()
ANS = psd.encode('hex')
print ANS
b = ['00','01','02','03','04','05','06','07','08']
cool = False
for i in range(9,10):
qq = itertools.permutations(b,i)
nl = list(qq)
for j in range(0,len(nl)):
t1=''.join(nl[j])
t2 = hashlib.sha1(t1.decode('hex')).hexdigest()
if(t2==ANS):
print 'the answer is :'+str(nl[j])
cool = True
break;
if(cool==True):
break;
if(cool==True):
break;
if(cool==False):
print 'Sorry...'