Longest Lines
Detecting cycles