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
IlllIlIllllllIIIlIll, IlIIIIIIIIlIIlIlIl = Action.C, Action.D
IllllIIIIIIIIIlIlIl = (IlllIlIllllllIIIlIll, IlIIIIIIIIlIIlIlIl)
IlIIllIIllllllIl = Tuple[int, Action, int, Action]
class IllIlIIIlIlIIIllIl(Player):
    IIIIlIlllIl = "strategy"
    IlIlIIIIIll: Dict[Text, Any] = {
        "memory_depth": 1,
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(
        IIlIIlIIIlI,
        lIllIIllIIIlIIllll: Tuple[IlIIllIIllllllIl, ...] = ((1, IlllIlIllllllIIIlIll, 1, IlllIlIllllllIIIlIll), (1, IlIIIIIIIIlIIlIlIl, 1, IlIIIIIIIIlIIlIlIl)),
        IllIllIl: int = 1,
        IlIIlIlIIIIllll: Action = IlllIlIllllllIIIlIll,
    ) -> None:
        Player.__init__(IIlIIlIIIlI)
        IIlIIlIIIlI.IllIllIl = IllIllIl
        IIlIIlIIIlI.IlIIlIlIIIIllll = IlIIlIlIIIIllll
        IIlIIlIIIlI.lIlIIIllllIllll = SimpleFSM(lIllIIllIIIlIIllll, IllIllIl)
    def IIIlIIlllllIlIlIl(IIlIIlIIIlI, IIIIIlllIIllIlIIIllI: Player) -> Action:
        if len(IIlIIlIIIlI.history) == 0:
            return IIlIIlIIIlI.IlIIlIlIIIIllll
        else:
            return IIlIIlIIIlI.lIlIIIllllIllll.move(IIIIIlllIIllIlIIIllI.history[-1])
class lIlllllIlIlIllIl(IllIlIIIlIlIIIllIl):
    IIIIlIlllIl = "strategy"
    IlIlIIIIIll = {
        "memory_depth": float("inf"),
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(IIlIIlIIIlI) -> None:
        lIllIIllIIIlIIllll = (
            (0, IlllIlIllllllIIIlIll, 2, IlIIIIIIIIlIIlIlIl),
            (0, IlIIIIIIIIlIIlIlIl, 2, IlIIIIIIIIlIIlIlIl),
            (1, IlllIlIllllllIIIlIll, 1, IlllIlIllllllIIIlIll),
            (1, IlIIIIIIIIlIIlIlIl, 1, IlIIIIIIIIlIIlIlIl),
            (2, IlllIlIllllllIIIlIll, 0, IlIIIIIIIIlIIlIlIl),
            (2, IlIIIIIIIIlIIlIlIl, 3, IlllIlIllllllIIIlIll),
            (3, IlllIlIllllllIIIlIll, 0, IlIIIIIIIIlIIlIlIl),
            (3, IlIIIIIIIIlIIlIlIl, 1, IlllIlIllllllIIIlIll),
        )
        super().__init__(
            lIllIIllIIIlIIllll=lIllIIllIIIlIIllll, IllIllIl=0, IlIIlIlIIIIllll=IlIIIIIIIIlIIlIlIl
        )