<gh_stars>100-1000
import networkx as nx

with open('input06', 'r') as data:
    G = nx.Graph(item.strip().split(')') for item in data.readlines())

print(sum(nx.shortest_path_length(G, 'COM').values())) # Part 1

print(nx.shortest_path_length(G, 'YOU', 'SAN') - 2) # Part 2

import networkx as nx

with open('input06', 'r') as data:
    G = nx.Graph(item.strip().split(')') for item in data.readlines())

print(sum(nx.shortest_path_length(G, 'COM').values())) # Part 1

print(nx.shortest_path_length(G, 'YOU', 'SAN') - 2) # Part 2
# Part 1 # Part 2