import itertools
from typing import Any, Dict, List, Optional, Sequence, Text, Tuple
from axelrod.action import Action
from axelrod.evolvable_player import (
    EvolvablePlayer,
    InsufficientParametersError,
    copy_lists,
)
from axelrod.player import Player
lIIIlIlllllIll, lIlIlIlIllIllllIl = Action.C, Action.D
llIIIlIIllIIlIl = (lIIIlIlllllIll, lIlIlIlIllIllllIl)
lIlllllIlIIIIllI = Tuple[int, Action, int, Action]
class IIIlIIIlIlIIl(Player):
    IllIlIllIl = "strategy"
    IIIIIlllll: Dict[Text, Any] = {
        "memory_depth": 1,
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(
        lIIlIllIllIlIlllllI,
        IIlllIIlIIIIlIIIIlI: Tuple[lIlllllIlIIIIllI, ...] = ((1, lIIIlIlllllIll, 1, lIIIlIlllllIll), (1, lIlIlIlIllIllllIl, 1, lIlIlIlIllIllllIl)),
        IIIlIIIIIlIIl: int = 1,
        lllIlIIIlIlIllI: Action = lIIIlIlllllIll,
    ) -> None:
        Player.__init__(lIIlIllIllIlIlllllI)
        lIIlIllIllIlIlllllI.IIIlIIIIIlIIl = IIIlIIIIIlIIl
        lIIlIllIllIlIlllllI.lllIlIIIlIlIllI = lllIlIIIlIlIllI
        lIIlIllIllIlIlllllI.lllIlIlIlll = SimpleFSM(IIlllIIlIIIIlIIIIlI, IIIlIIIIIlIIl)
    def IIIIlllIIIIlII(lIIlIllIllIlIlllllI, IlIIIIlIlIIlIIll: Player) -> Action:
        if len(lIIlIllIllIlIlllllI.history) == 0:
            return lIIlIllIllIlIlllllI.lllIlIIIlIlIllI
        else:
            return lIIlIllIllIlIlllllI.lllIlIlIlll.move(IlIIIIlIlIIlIIll.history[-1])
class lllIIllllllllllIIIl(IIIlIIIlIlIIl):
    IllIlIllIl = "strategy"
    IIIIIlllll = {
        "memory_depth": float("inf"),
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(lIIlIllIllIlIlllllI) -> None:
        IIlllIIlIIIIlIIIIlI = (
            (1, lIIIlIlllllIll, 2, lIIIlIlllllIll),
            (1, lIlIlIlIllIllllIl, 6, lIlIlIlIllIllllIl),
            (2, lIIIlIlllllIll, 2, lIIIlIlllllIll),
            (2, lIlIlIlIllIllllIl, 3, lIlIlIlIllIllllIl),
            (3, lIIIlIlllllIll, 6, lIIIlIlllllIll),
            (3, lIlIlIlIllIllllIl, 1, lIlIlIlIllIllllIl),
            (4, lIIIlIlllllIll, 3, lIIIlIlllllIll),
            (4, lIlIlIlIllIllllIl, 6, lIlIlIlIllIllllIl),
            (5, lIIIlIlllllIll, 5, lIlIlIlIllIllllIl),
            (5, lIlIlIlIllIllllIl, 4, lIlIlIlIllIllllIl),
            (6, lIIIlIlllllIll, 3, lIIIlIlllllIll),
            (6, lIlIlIlIllIllllIl, 5, lIlIlIlIllIllllIl),
        )
        super().__init__(
            IIlllIIlIIIIlIIIIlI=IIlllIIlIIIIlIIIIlI, IIIlIIIIIlIIl=1, lllIlIIIlIlIllI=lIlIlIlIllIllllIl
        )