input adjacency matrices