The relation between the given compounds can be determined assigning them $R$ and $S$ configuration. The given structures can be represented as
$M$ and $N$ are diastereomers.
$M$ and $O$ are identical.
$M$ and $P$ are enantiomers (non-superimposable mirror images).
$M$ and $Q$ are diastereomers.