Write a function to detect fraudulent transaction patterns in a stream of payment data.
Implement detect_fraudulent_patterns(transactions, window_seconds, max_transactions). Each transaction is a dictionary with account_id and integer timestamp, and timestamps are in nondecreasing order. Return a sorted list of account IDs that have more than max_transactions transactions within any trailing window_seconds interval. An account should appear only once in the result.
def detect_fraudulent_patterns(transactions, window_seconds, max_transactions):