11504 - Dominos

Graphs, Topological sort, DFS.