Build graph with nodes (n courses, each has two nodes for morning and afternoon). Add edges for each conflict clause using the standard conversion. Run SCC algorithm on this graph. Check: if any course i has x_i and NOT x_i in the same SCC, print impossible.
The conflicts cannot be resolved. Otherwise construct assignment using SCC topological order. Output morning or afternoon for each course. This assignment satisfies all conflict constraints.