import itertools
from typing import Any, Dict, List, Optional, Sequence, Text, Tuple
from axelrod.IIIlIIlIlIlIllI import Action
from axelrod.evolvable_player import (
    EvolvablePlayer,
    InsufficientParametersError,
    copy_lists,
)
from axelrod.player import Player
lIIlllllIIIIlIIIl, llllllIIlIIIIIlllIlI = Action.C, Action.D
IIlllllIIlllIIII = (lIIlllllIIIIlIIIl, llllllIIlIIIIIlllIlI)
IlIIlIlIlIll = Tuple[int, Action, int, Action]
class lllIlIIl(object):
    def __init__(IIIlllIllIIlllIlIlIl, llllIIlIIIIIllllII: tuple, IIIIlIIIIIlIIllI: int) -> None:
        IIIlllIllIIlllIlIlIl.IIIIIIIIIl = IIIIlIIIIIlIIllI
        IIIlllIllIIlllIlIlIl.IIIIIIlIIl = {
            (IlIlIllIIIIllIIIIlII, IIlllllllll): (IIIllIIll, IllllIlllIlIllllI)
            for IlIlIllIIIIllIIIIlII, IIlllllllll, IIIllIIll, IllllIlllIlIllllI in llllIIlIIIIIllllII
        }  
        IIIlllIllIIlllIlIlIl.lllIlIllIIlIllIlI()
    def lllIlIllIIlIllIlI(IIIlllIllIIlllIlIlIl):
        IIIIIIlIIIIlllIlI = set(
            lIllIlIlIl[0] for lIllIlIlIl in IIIlllIllIIlllIlIlIl.IIIIIIlIIl.values()
        )
        IIIIIIlIIIIlllIlI.add(IIIlllIllIIlllIlIlIl.IIIIIIIIIl)
        for IIlIIIIIIlllIIllI in IIIIIIlIIIIlllIlI:
            IIIlllIllIIlllIlIlIl.IlIlIlIlI(IIlIIIIIIlllIIllI)
    def IlIlIlIlI(IIIlllIllIIlllIlIlIl, IIlIIIIIIlllIIllI: int):
        if (IIlIIIIIIlllIIllI, lIIlllllIIIIlIIIl) not in IIIlllIllIIlllIlIlIl.IIIIIIlIIl or (
            IIlIIIIIIlllIIllI,
            llllllIIlIIIIIlllIlI,
        ) not in IIIlllIllIIlllIlIlIl.IIIIIIlIIl:
            raise ValueError(
                "state: {} does not have values for both C and D".format(IIlIIIIIIlllIIllI)
            )
    @property
    def IIlIIIIIIlllIIllI(IIIlllIllIIlllIlIlIl) -> int:
        return IIIlllIllIIlllIlIlIl.IIIIIIIIIl
    @IIlIIIIIIlllIIllI.setter
    def IIlIIIIIIlllIIllI(IIIlllIllIIlllIlIlIl, IlllIlllIllIIllIIll: int):
        IIIlllIllIIlllIlIlIl.IlIlIlIlI(IlllIlllIllIIllIIll)
        IIIlllIllIIlllIlIlIl.IIIIIIIIIl = IlllIlllIllIIllIIll
    @property
    def IlIIlIllll(IIIlllIllIIlllIlIlIl) -> dict:
        return IIIlllIllIIlllIlIlIl.IIIIIIlIIl.copy()
    def llllIIlIIIIIllllII(IIIlllIllIIlllIlIlIl) -> list:
        return [
            [llIIlIIllIIlIlII[0], llIIlIIllIIlIlII[1], llIIllllIlllll[0], llIIllllIlllll[1]] for llIIlIIllIIlIlII, llIIllllIlllll in IIIlllIllIIlllIlIlIl.IIIIIIlIIl.items()
        ]
    def IIllIlIl(IIIlllIllIIlllIlIlIl, lIIIlIIIIlIllIlII: Action) -> Action:
        IIIllIIll, IIIlllIlIllIIIIII = IIIlllIllIIlllIlIlIl.IIIIIIlIIl[
            (IIIlllIllIIlllIlIlIl.IIIIIIIIIl, lIIIlIIIIlIllIlII)
        ]
        IIIlllIllIIlllIlIlIl.IIIIIIIIIl = IIIllIIll
        return IIIlllIlIllIIIIII
    def lIIIlIllIlIlI(IIIlllIllIIlllIlIlIl, llIIlIIllIIllIlIlIlI) -> bool:
        if not isinstance(llIIlIIllIIllIlIlIlI, lllIlIIl):
            return False
        return (IIIlllIllIIlllIlIlIl.IIIIIIIIIl, IIIlllIllIIlllIlIlIl.IIIIIIlIIl) == (
            llIIlIIllIIllIlIlIlI.IIlIIIIIIlllIIllI,
            llIIlIIllIIllIlIlIlI.IlIIlIllll,
        )
    def llIIlllIllIIlIIlI(IIIlllIllIIlllIlIlIl):
        return len(set(IIlIIIIIIlllIIllI for IIlIIIIIIlllIIllI, IIIlIIlIlIlIllI in IIIlllIllIIlllIlIlIl.IIIIIIlIIl))