import random
import logging

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

class Book:
    def __init__(self):
        """
        Initializes a Book object with a randomly generated title, author, and pages.
        """
        self.title = self.generate_word().capitalize()
        self.author = self.generate_word().capitalize() + ' ' + self.generate_word().capitalize()
        self.pages = []
        for i in range(100):
            self.pages.append(self.generate_page())

    def generate_word(self):
        """
        Generates a random word with alternating consonants and vowels.

        :return: Randomly generated word.
        :rtype: str
        """
        vowels = 'аеёиоуэюя'
        consonants = 'бвгджзйклмнпрстфхцчшщ'
        length = random.randint(2, 8)
        word = ""
        for i in range(length):
            if i % 2 == 0:
                word += random.choice(consonants)
            else:
                word += random.choice(vowels)
        return word

    def generate_page(self):
        """
        Generates a random page consisting of multiple random words.

        :return: Randomly generated page.
        :rtype: str
        """
        text = []
        for i in range(random.randint(5, 20)):
            text.append(self.generate_word())
        return ' '.join(text)

class Library:
    def __init__(self):
        """
        Initializes a Library object with a list of 10 randomly generated Book objects.
        """
        self.books = []
        for i in range(10):
            self.books.append(Book())

    def find_book(self, title):
        """
        Finds a Book object in the library with the specified title.

        :param title: Title of book to search for.
        :type title: str
        :return: Book object with specified title, or None if not found.
        :rtype: Book or None
        """
        for book in self.books:
            if book.title.lower() == title.lower():
                return book
        return None

    def find_page(self, title, page_number):
        """
        Finds a specific page in a Book object with the specified title.

        :param title: Title of book to search for.
        :type title: str
        :param page_number: Number of page to search for.
        :type page_number: int
        :return: Text of specified page, or "Invalid page number" if page number is out of range,
                 or "Book not found" if book with specified title is not found.
        :rtype: str
        """
        book = self.find_book(title)
        if book:
            if page_number >= 1 and page_number <= len(book.pages):
                return book.pages[page_number - 1]
            else:
                logger.error("Invalid page number for book: %s", title)
                return "Invalid page number"
        else:
            logger.error("Book not found: %s", title)
            return "Book not found"

# Example usage
library = Library()

# Print all books in library
for book in library.books:
    logger.info("%s by %s", book.title, book.author)

# Print random page from random book
book = random.choice(library.books)
page_number = random.randint(1, len(book.pages))
logger.info("Random page from %s: Page %d\n%s", book.title, page_number, book.pages[page_number - 1])

# Find specific page in specific book based on user input
query_book = input("Enter book title to search for: ")
query_page = int(input("Enter page number to search for: "))
result = library.find_page(query_book, query_page)
logger.info("Result: %s", result)
что нужно делать, чтобы выводились слова