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
lIlIIlIIIIlIlIlllIII, IllIIIIllllIII = Action.C, Action.D
IllIIlllIllIIIIlII = (lIlIIlIIIIlIlIlllIII, IllIIIIllllIII)
IIIIIlIllIIlIIll = Tuple[int, Action, int, Action]
class IIlIllIlllllIIIlII(Player):
    llIlIIIIlI = "strategy"
    lIlIlIllIllI: Dict[Text, Any] = {
        "memory_depth": 1,
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(
        IIlIlIlIlllIIllI,
        lIlIlIIIlIIIIll: Tuple[IIIIIlIllIIlIIll, ...] = ((1, lIlIIlIIIIlIlIlllIII, 1, lIlIIlIIIIlIlIlllIII), (1, IllIIIIllllIII, 1, IllIIIIllllIII)),
        llIIIIIIIIIlII: int = 1,
        lIIIIllIll: Action = lIlIIlIIIIlIlIlllIII,
    ) -> None:
        Player.__init__(IIlIlIlIlllIIllI)
        IIlIlIlIlllIIllI.llIIIIIIIIIlII = llIIIIIIIIIlII
        IIlIlIlIlllIIllI.lIIIIllIll = lIIIIllIll
        IIlIlIlIlllIIllI.IlIIlllIlIllIl = SimpleFSM(lIlIlIIIlIIIIll, llIIIIIIIIIlII)
    def IlllIlIllllIIIIIlI(IIlIlIlIlllIIllI, llIIIIIIIlIIIIllIII: Player) -> Action:
        if len(IIlIlIlIlllIIllI.history) == 0:
            return IIlIlIlIlllIIllI.lIIIIllIll
        else:
            return IIlIlIlIlllIIllI.IlIIlllIlIllIl.move(llIIIIIIIlIIIIllIII.history[-1])
class IlIIlllllIllllI(IIlIllIlllllIIIlII):
    llIlIIIIlI = "strategy"
    lIlIlIllIllI = {
        "memory_depth": float("inf"),
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(IIlIlIlIlllIIllI) -> None:
        lIlIlIIIlIIIIll = (
            (0, lIlIIlIIIIlIlIlllIII, 0, lIlIIlIIIIlIlIlllIII),
            (0, IllIIIIllllIII, 12, IllIIIIllllIII),
            (1, lIlIIlIIIIlIlIlllIII, 3, IllIIIIllllIII),
            (1, IllIIIIllllIII, 6, lIlIIlIIIIlIlIlllIII),
            (2, lIlIIlIIIIlIlIlllIII, 2, IllIIIIllllIII),
            (2, IllIIIIllllIII, 14, IllIIIIllllIII),
            (3, lIlIIlIIIIlIlIlllIII, 3, IllIIIIllllIII),
            (3, IllIIIIllllIII, 3, IllIIIIllllIII),
            (5, lIlIIlIIIIlIlIlllIII, 12, IllIIIIllllIII),
            (5, IllIIIIllllIII, 10, IllIIIIllllIII),
            (6, lIlIIlIIIIlIlIlllIII, 5, lIlIIlIIIIlIlIlllIII),
            (6, IllIIIIllllIII, 12, IllIIIIllllIII),
            (7, lIlIIlIIIIlIlIlllIII, 3, IllIIIIllllIII),
            (7, IllIIIIllllIII, 1, lIlIIlIIIIlIlIlllIII),
            (8, lIlIIlIIIIlIlIlllIII, 5, lIlIIlIIIIlIlIlllIII),
            (8, IllIIIIllllIII, 5, lIlIIlIIIIlIlIlllIII),
            (10, lIlIIlIIIIlIlIlllIII, 11, IllIIIIllllIII),
            (10, IllIIIIllllIII, 8, lIlIIlIIIIlIlIlllIII),
            (11, lIlIIlIIIIlIlIlllIII, 15, IllIIIIllllIII),
            (11, IllIIIIllllIII, 5, IllIIIIllllIII),
            (12, lIlIIlIIIIlIlIlllIII, 8, lIlIIlIIIIlIlIlllIII),
            (12, IllIIIIllllIII, 11, IllIIIIllllIII),
            (13, lIlIIlIIIIlIlIlllIII, 13, IllIIIIllllIII),
            (13, IllIIIIllllIII, 7, IllIIIIllllIII),
            (14, lIlIIlIIIIlIlIlllIII, 13, IllIIIIllllIII),
            (14, IllIIIIllllIII, 13, IllIIIIllllIII),
            (15, lIlIIlIIIIlIlIlllIII, 15, IllIIIIllllIII),
            (15, IllIIIIllllIII, 2, lIlIIlIIIIlIlIlllIII),
        )
        super().__init__(
            lIlIlIIIlIIIIll=lIlIlIIIlIIIIll, llIIIIIIIIIlII=0, lIIIIllIll=lIlIIlIIIIlIlIlllIII
        )