Your program should output a file callgraph.txt with two parts using the following structure. The two parts are separated by an empty line.

First part: the nodes

Each node is presented in one line as follows: number, phone number, name, city, total time spent; where number is a sequential number starting from 1 that identifies the node. Total time spent is the total number of seconds in calls initiated by the phone number.

Second part: the edges

Each edge is presented in one line as follows: number of origin, number of destination, weight; where number origin and destination are numbers identifying the nodes in the first part of the file. 

An example of the callgraph.txt file could look like this. Note that the nodes are sorted by phone number.

```
2, 7801234567, Ameneh Gholipour Shahraki, Hinton, 198473
7, 7801236789, Stuart Johnson, Saint Albert, 64399
4, 7803214567, Md Toukir Imam, Sherwood Park, 179532
8, 7804321098, Hamman Samuel, Stony Plain, 57909
1, 7804922860, Osmar Zaiane, Edmonton, 250068
5, 7807890123, Elham Ahmadi, Devon, 129370
9, 7808765432, Amir Hossein Faghih Dinevari, Beaumont, 62552
6, 7808907654, Weifeng Chen, Spruce Grove, 121726
3, 7809876543, Farrukh Ahmed, Edson, 190211

2, 7, 40425
2, 4, 21618
2, 8, 34186
2, 1, 34291
2, 5, 24286
2, 9, 67786
2, 6, 21983
2, 3, 35614
7, 4, 32851
7, 8, 27293
7, 1, 45367

```

Now for my question: I am trying out to figure out how to complete the second part and I am just stuck. My question is that every unique number is a node, to which I assign a number ranging from 1 to how many unique numbers there are. What I want is when say a number calls another it will print out the two nodes and then also say for how long they talked between themselves and do that for every number. Any advice is appreciated. 

This is the code I have so far, which answers the first part. 

```
customers=open('customers.txt','r')
calls=open('calls.txt.','r')
nodes= {}
name={}
city={}
total_spent_time={}
with open("customers.txt") as fp:
    for line in fp:
        number = line.split(";")[0]
        if number not in nodes:
            nodes[number] = len(nodes) + 1
        rows=line.split(";")
        name[rows[0]]=rows[1]
        city[rows[0]]=rows[2].strip("\n")
with open("calls.txt") as fp2:    
    for lines in fp2:
        rows2=lines.split(";")
        if rows2[1] not in total_spent_time:
            total_spent_time[rows2[1]]=int(rows2[3])
        elif rows2[1]  in total_spent_time:
            total_spent_time[rows2[1]]+=int(rows2[3])
    print(total_spent_time)

```

Link to calls.txt file : <http://pastebin.com/RSMnXDtq>

Link to customers.txt file: <http://pastebin.com/xMx15nCS>