get the first element of each tuple from a list of tuples `g`,[x[0] for x in G]