def a_edge_reversed(s, initial, initial_reversed):
    """
    If an a-edge can be validly reversed, return the result of the reversal.
    Otherwise, return None.
    """
    # precondition for validity:
    if s.endswith('A'):
        s2 = s[:-1]
        # postcondition for validity:
        if initial in s2 or initial_reversed in s2:
            return s2