Write a program to demonstrate polymorphism in a real-world scenario.
Implement process_documents(documents) using a shared document interface and separate subclasses for invoices, forms, and contracts. Each subclass must override the same processing method, and the main function must process all inputs polymorphically without type-specific calculation logic in its iteration loop.
Input is a list of dictionaries. Each dictionary contains kind and fields required by that kind. Return an object containing per-document results and the total cost.
Supported calculations: invoices cost pages * 2 plus 5 for urgent priority, forms cost pages + attachments * 2, and contracts cost pages * 3 + clauses.
def process_documents(documents):