Finding the shorter sides