Crop Rotation Algorithm (Python)