import hashlib a=['swswssd','swsswsd','sswwssd','sswswsd'] b=[] for i in range(60): b.append(0) def dfs(n,w,t): global b
if(w>5): return if(n==10): if(w==5): #print(b) p = '' for i in range(0,50): p+=str(b[i]) if(hashlib.md5(p.encode(encoding='UTF-8')).hexdigest()=='dcc1df36a15968fb206fe52294bb4130'): print(p) return for i in range(4): for j in range(7): b[t+j]=a[i][j] dfs(n+1,w+1,t+7) b[t]='s' b[t+1]='s' b[t+2]='d' dfs(n+1,w,t+3) def md5sum(str): m=hashlib.md5() m.update(str)
from hashlib import md5 from heapq import * a, b, c = (2137, 3001, 4729) heap = [] heappush(heap, 1) visted = set() visted.add(1) def Print(num): print(num) s= str(num).encode(encoding='utf-8') print("flag{%s}"%(md5(s).hexdigest())) cnt = 0 while True: Min = heappop(heap) cnt+=1 if(cnt==100000): Print(Min) break Num = Min*a if(not Num in visted): visted.add(Num) heappush(heap, Num) Num = Min*b if(not Num in visted): visted.add(Num) heappush(heap, Num) Num = Min*c if(not Num in visted): visted.add(Num) heappush(heap, Num)