Utility functions for finding lessons
We need utility functions to find lessons by some rules:
- Previous or next lesson of same teacher
- Previous or next lesson of same group(s)
- Previous or next lesson in same subject in this group
- Lessons of a person (student)