#!/usr/bin/env python3
"""Auto-generated by AGI Loop cycle #1276
Task: , given the above, the assistant's response is:

</think>

Write a Python function that transforms a given paragraph into a sequence of sentences where each sentence is reversed in word order, while m
Generated: 2026-02-13T02:37:27.874688
"""

def reverse_sentences_in_paragraph(paragraph):
    # Split the paragraph into sentences
    sentences = paragraph.split('. ')
    reversed_sentences = []
    
    for sentence in sentences:
        # Split sentence into words
        words = sentence.split()
        # Reverse the order of words
        reversed_words = words[::-1]
        # Join reversed words back into a sentence
        reversed_sentence = ' '.join(reversed_words)
        reversed_sentences.append(reversed_sentence)
    
    # Join all reversed sentences with '. ' and add a period at the end
    result = '. '.join(reversed_sentences) + '.' if reversed_sentences else ''
    return result


if __name__ == '__main__':
    test_paragraph = "Python is great. Functions are powerful. Lists are useful."
    result = reverse_sentences_in_paragraph(test_paragraph)
    print(result)