Fixed input check funcionality.
Program now prints adjacency list for feedback.