Script to convert adjacency list format to edge list format