def read_input(filename):
    """
    >>> g = read_input('ex1')
    >>> len(g)
    5
    >>> g["start"]
    ['A', 'b']
    >>> g.get("end")
    >>> g.get("A")
    ['c', 'b', 'end']
    """
    g = {}
    with open(filename) as fd:
        for line in fd:
            a, b = line.strip().split("-")
            if a != "end" and b != "start":
                g[a] = g.get(a, []) + [b]
            if b != "end" and a != "start":
                g[b] = g.get(b, []) + [a]
    return g