Write a program in C++/Java that performs a DFS on following

Write a program in C++/Java that performs a DFS on following graph and ouputs edges with labels, tree edge, back edge, forward edge and cross edge.Submit your program and screen shot of outputs in a single word/pdf file.Your program should accept following file as an input. You have to write code to process this input. You should define and use adjacency list representation of graph.The input in the file is in this format:First line is number of nodes.Rest of lines are in this format: node number (node degree) : adjacency list