#!/usr/bin/env python3
"""Auto-generated by AGI Loop cycle #1179
Task: </think>

Write a Python function that transforms a 3D tensor represented as a nested list into a flattened list, while preserving the original order of elements as if traversed in column-major (Fortr
Generated: 2026-02-12T23:08:01.834374
"""

def flatten_tensor_column_major(tensor):
    # Flatten the tensor using column-major order
    flattened = []
    # Get the dimensions
    depth = len(tensor)
    rows = len(tensor[0])
    cols = len(tensor[0][0])
    
    # Traverse in column-major order
    for col in range(cols):
        for row in range(rows):
            for depth_idx in range(depth):
                flattened.append(tensor[depth_idx][row][col])
    return flattened

if __name__ == '__main__':
    # Example 3D tensor represented as a nested list
    tensor = [
        [[1, 2, 3],
         [4, 5, 6]],
        [[10, 20, 30],
         [40, 50, 60]]
    ]
    
    # Flatten the tensor
    result = flatten_tensor_column_major(tensor)
    
    # Print the result
    print("Flattened list (column-major order):", result)