Solution for the first lab at "Introduction to Theoretical Computer Science" course