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
IIlllIllIlIIIllIIllI, IIlllIlIlIIll = Action.C, Action.D
class llIllIlIlIllIllIlll(Player):
    lIllIIlIlIlIlI = "strategy"
    IIIlIIIllllIlIIllII = {
        "memory_depth": float("inf"),
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(IIlIIIlI) -> None:
        super().__init__()
        IIlIIIlI.lllllIll = True
    def lIIllIIlIllI(IIlIIIlI, lIlllIIII: Player) -> Action:
        if not IIlIIIlI.history:
            return IIlllIlIlIIll
        if IIlIIIlI.lllllIll:
            if lIlllIIII.history[-1] == IIlllIlIlIIll:
                IIlIIIlI.lllllIll = False
                return IIlllIllIlIIIllIIllI
            lIIIIlIllIIllIIl = IIlIIIlI.cooperations / len(IIlIIIlI.history)
            if lIIIIlIllIIllIIl > 0.5:
                return IIlllIlIlIIll
            return IIlllIllIlIIIllIIllI
        else:
            return lIlllIIII.history[-1]