"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-05 23:15:06.221142
"""

```python
class FallbackExecutor:
    """
    A class for executing a main function with fallback strategies in case of errors.

    :param main_function: Callable, The primary function to execute.
    :param fallback_functions: List[Callable], Optional list of functions to try if the main function fails.
    """

    def __init__(self, main_function, *, fallback_functions=None):
        self.main_function = main_function
        self.fallback_functions = fallback_functions or []

    def execute(self) -> any:
        """
        Executes the main function. If it fails, tries each fallback function in order.

        :return: The result of the executed function.
        """
        try:
            return self.main_function()
        except Exception as e:
            print(f"Main function failed with error: {e}")
            
            for index, fallback_func in enumerate(self.fallback_functions):
                try:
                    return fallback_func()
                except Exception as ex:
                    if index == len(self.fallback_functions) - 1:
                        raise RuntimeError("All functions failed.") from e
                    print(f"Fallback function #{index + 1} failed with error: {ex}")

# Example usage

def main_function():
    """
    A simple main function that might fail.
    """
    result = 1 / 0  # Simulate a division by zero error
    return result

def fallback_function_1():
    """
    A simple first fallback function.
    """
    print("Falling back to the first function.")
    return "Fallback 1"

def fallback_function_2():
    """
    A simple second fallback function.
    """
    print("Falling back to the second function.")
    return "Fallback 2"

# Creating an instance of FallbackExecutor
executor = FallbackExecutor(main_function, fallback_functions=[fallback_function_1, fallback_function_2])

# Executing the main program
result = executor.execute()
print(f"Result: {result}")
```