from typing import List
import numpy as np
from axelrod.action import Action
from axelrod.interaction_utils import compute_final_score
from axelrod.player import Player
from axelrod.strategies.finite_state_machines import FSMPlayer
IIIIlIIlllIlIl, IIIlIlIIllllII = Action.C, Action.D
class llllIllIIIIIlll(Player):
    IIIIllllI = "strategy"
    lIlllIIIIIIIIlI = {
        "memory_depth": float("inf"),
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(lIlllIlIllIIlllIlllI) -> None:
        super().__init__()
        lIlllIlIllIIlllIlllI.IIIlIIIIlIIlI = False
    def lIllIlIllIlI(lIlllIlIllIIlllIlllI, IIIIlIIIl: Player) -> Action:
        if not IIIIlIIIl.history:
            return IIIlIlIIllllII
        if lIlllIlIllIIlllIlllI.IIIlIIIIlIIlI:
            return IIIlIlIIllllII if IIIIlIIIl.history[-1:] == [IIIlIlIIllllII] else IIIIlIIlllIlIl
        else:
            if IIIIlIIIl.history[-1] == IIIlIlIIllllII:
                lIlllIlIllIIlllIlllI.IIIlIIIIlIIlI = True
                return IIIIlIIlllIlIl
            if len(lIlllIlIllIIlllIlllI.history) in [1, 2]:
                return IIIIlIIlllIlIl
            return lIlllIlIllIIlllIlllI.history[-1].flip()