import java.util.Vector;

public class Graph  {

    int n, m;
    Vector <Vector<Integer>> edges; 

    public Graph (int n) {
        this. n = n;
        edges = new Vector<Vector<Integer>> ();
        for (int i = 0; i < n; i++) {
            edges.add(new Vector<Integer> ());
        }
    }
    public void addEdge(int u, int v) {
        edges.get(u).add(Integer.valueOf(v));
        edges.get(v).add(Integer.valueOf(u));
    }
}