def r_find_last_common(CL0_r, DoneSet0, CL1_r, DoneSet1):
    """CL0_r, CL1_r -- reversed versions of the command lists CL1 and CL0.

           i:  0 1 2 3 4 5 6 7 8           k:  0 1 2 3 4 5 6     
              .-.-.-.-.-.-.-.-.-.             .-.-.-.-.-.-.-.
              |g|B|i|j|k|l|A|m|o|             |a|b|c|B|A|e|f|
              '-'-'-'-'-'-'-'-'-'             '-'-'-'-'-'-'-'
                     
    If i=8 and k=6, then the last common command is 'A'. Thus the indices of
    the last common command would be: (6, 4).  If i=5 and k=6, then the last
    common command id 'B' and the result is (1, 3).
                     
    RETURNS: [0], [1]    Indices of last common command.
             None, None  If no common command is found.
    """
    for i, cmd_i in enumerate(CL0_r):
        if i in DoneSet0: continue
        for k, cmd_k in enumerate(CL1_r):
            if k in DoneSet1:    continue
            elif cmd_i == cmd_k: return i, k
    return None, None