import json
import sys

user_id = dict()
follows = []


for line in sys.stdin:
    fixed_line = "{" + line[line.find("login")-1:]
    user = json.loads(fixed_line)
    user_id[user["login"]] = user["id"]
    follows.append((user["login"], user["follows"]))

follows_int = []

for (a, b) in follows:
    if a in user_id and b in user_id:
        print(user_id[a], user_id[b])

@@ -31,14 +31,10 @@
 d = 
-dict()
+%7B%7D
 %0Afol
@@ -49,82 +49,144 @@
 %5D%0A%0A%0A
-for line in sys.stdin:%0A    fixed_line = %22%7B%22 + line%5Bline.find(%22login%22)-1:%5D%0A
+def fix_line(line):%0A    return %22%7B%22 + line%5Bline.find(%22),%22)+2:%5D%0A%0A%0Afor line in sys.stdin:%0A    try:%0A        fixed_line = fix_line(line)%0A    
     
@@ -215,24 +215,28 @@
 d_line)%0A    
+ 
+   
 user_id%5Buser
@@ -259,16 +259,20 @@
 r%5B%22id%22%5D%0A
+    
     foll
@@ -315,16 +315,131 @@
 lows%22%5D))
+%0A    except Exception as e:%0A        print(%22Invalid line:%22, line, file=sys.stderr)%0A        print(e, file=sys.stderr)
 %0A%0Afollow

improve the code for creating the followers graph