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
IIIIIlIIIllIIIIIIII, IlIlllll = Action.C, Action.D
lIlIIIllIllllllllIl = (IIIIIlIIIllIIIIIIII, IlIlllll)
lIIIlllIIlll = Tuple[int, Action, int, Action]
class IlIllIllIIl(Player):
    IIlllIll = "strategy"
    IIlllIlIIIIlIIIIIIl: Dict[Text, Any] = {
        "memory_depth": 1,
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(
        IIIlIIlIllIIlIl,
        IIIlIllIIl: Tuple[lIIIlllIIlll, ...] = ((1, IIIIIlIIIllIIIIIIII, 1, IIIIIlIIIllIIIIIIII), (1, IlIlllll, 1, IlIlllll)),
        lIlIlIlIlllI: int = 1,
        lIIllIIllIl: Action = IIIIIlIIIllIIIIIIII,
    ) -> None:
        Player.__init__(IIIlIIlIllIIlIl)
        IIIlIIlIllIIlIl.lIlIlIlIlllI = lIlIlIlIlllI
        IIIlIIlIllIIlIl.lIIllIIllIl = lIIllIIllIl
        IIIlIIlIllIIlIl.lIlIIIlIIIlIII = SimpleFSM(IIIlIllIIl, lIlIlIlIlllI)
    def IlIllllIIIlllI(IIIlIIlIllIIlIl, lllllIIlllII: Player) -> Action:
        if len(IIIlIIlIllIIlIl.history) == 0:
            return IIIlIIlIllIIlIl.lIIllIIllIl
        else:
            return IIIlIIlIllIIlIl.lIlIIIlIIIlIII.move(lllllIIlllII.history[-1])
class lllIllIll(IlIllIllIIl):
    IIlllIll = "strategy"
    IIlllIlIIIIlIIIIIIl = {
        "memory_depth": 2,
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(IIIlIIlIllIIlIl) -> None:
        IIIlIllIIl = (
            (1, IIIIIlIIIllIIIIIIII, 1, IlIlllll),
            (1, IlIlllll, 2, IlIlllll),
            (2, IIIIIlIIIllIIIIIIII, 1, IlIlllll),
            (2, IlIlllll, 3, IIIIIlIIIllIIIIIIII),
            (3, IIIIIlIIIllIIIIIIII, 3, IIIIIlIIIllIIIIIIII),
            (3, IlIlllll, 1, IlIlllll),
        )
        super().__init__(
            IIIlIllIIl=IIIlIllIIl, lIlIlIlIlllI=1, lIIllIIllIl=IlIlllll
        )