#!/usr/bin/env python3

import sys
from collections import defaultdict, deque
#from dataclasses import dataclass

def main(args):
    seen = deque(map(int, '598701'))
    num = 100000000
    things = [3, 7]
    n1 = 0
    n2 = 1
    d = deque(things[-6:])
    i = 2
    while True:
        new = list(map(int, str(things[n1] + things[n2])))
        for c in new:
            i += 1
            if len(d) == len(seen):
                d.popleft()
            d.append(c)
            if i % 10000 == 0:
                print(i, d, seen)
            if d == seen:
                print(i - len(seen))
                return
        things.extend(new)
        n1 = (n1 + 1 + things[n1]) % len(things)
        n2 = (n2 + 1 + things[n2]) % len(things)


    lol = ''.join(str(i) for i in things)
    print(lol.index(seen))

    print(''.join(str(i) for i in things[num:num+10]))




if __name__ == '__main__':
    sys.exit(main(sys.argv))

@@ -31,86 +31,8 @@
  sys
-%0Afrom collections import defaultdict, deque%0A#from dataclasses import dataclass
 %0A%0Ade
@@ -56,21 +56,20 @@
  seen = 
-deque
+list
 (map(int
@@ -85,28 +85,8 @@
 '))%0A
-    num = 100000000%0A
     
@@ -127,35 +127,8 @@
 = 1%0A
-    d = deque(things%5B-6:%5D)%0A
     
@@ -162,30 +162,16 @@
    new =
- list(map(int,
  str(thi
@@ -191,18 +191,16 @@
 ngs%5Bn2%5D)
-))
 %0A       
@@ -205,16 +205,17 @@
    for c
+c
  in new:
@@ -231,78 +231,38 @@
     
-i += 1%0A            if len(d) == len(seen):%0A                d.popleft()
+c = int(cc)%0A            i += 1
 %0A   
@@ -270,17 +270,22 @@
         
-d
+things
 .append(
@@ -345,17 +345,8 @@
 nt(i
-, d, seen
 )%0A  
@@ -358,17 +358,35 @@
      if 
-d
+things%5B-len(seen):%5D
  == seen
@@ -451,35 +451,8 @@
 urn%0A
-        things.extend(new)%0A
     
@@ -551,137 +551,8 @@
 )%0A%0A%0A
-    lol = ''.join(str(i) for i in things)%0A    print(lol.index(seen))%0A%0A    print(''.join(str(i) for i in things%5Bnum:num+10%5D))%0A%0A%0A%0A%0A
 if _

remove some needless complication