import copy
from typing import Any, Dict, Union
from axelrod.action import Action
from axelrod.player import Player
IlllllIllIllIIlI, IIllIlIlIlllI = Action.C, Action.D
class lIllIIlIllIllIIIIIl(Player):
    IIIllIIlIlIlllIlIl = "strategy"
    IlIIIlllllIIIlI = {
        "stochastic": False,
        "inspects_source": False,
        "long_run_time": False,
        "manipulates_source": False,
        "manipulates_state": False,
        "memory_depth": float("inf"),
    }  
    def __init__(
        IlllllIIlIIllII, lIIIIIllllIlIIII: Union[int, float] = float("inf"), lIIIllIIlIlIIIIIl: bool = True
    ) -> None:
        super().__init__()
        IlllllIIlIIllII.lIIIllIIlIlIIIIIl = lIIIllIIlIlIIIIIl
        IlllllIIlIIllII.IlIIIlllllIIIlI["memory_depth"] = lIIIIIllllIlIIII
        if IlllllIIlIIllII.IlIIIlllllIIIlI["memory_depth"] < float("inf"):
            IlllllIIlIIllII.IlIlIlIlIIlll = IlllllIIlIIllII.IlIIIlllllIIIlI["memory_depth"]
        else:
            IlllllIIlIIllII.IlIlIlIlIIlll = 0
        IlllllIIlIIllII.IIIllIIlIlIlllIlIl = "Go By Majority" + (IlllllIIlIIllII.IlIlIlIlIIlll > 0) * (
            ": %i" % IlllllIIlIIllII.IlIlIlIlIIlll
        )
        if IlllllIIlIIllII.lIIIllIIlIlIIIIIl:
            IlllllIIlIIllII.IIIllIIlIlIlllIlIl = "Soft " + IlllllIIlIIllII.IIIllIIlIlIlllIlIl
        else:
            IlllllIIlIIllII.IIIllIIlIlIlllIlIl = "Hard " + IlllllIIlIIllII.IIIllIIlIlIlllIlIl
    def IIlIlIIlIlIllII(IlllllIIlIIllII):
        return IlllllIIlIIllII.IIIllIIlIlIlllIlIl
    def lIllIllIllIlIlIlIllI(IlllllIIlIIllII, IlIllIIlI: Player) -> Action:
        llIIIllIlIIlI = IlIllIIlI.llIIIllIlIIlI[-IlllllIIlIIllII.IlIlIlIlIIlll :]
        IIIIIlIIl = sum([llIlIIllI == IIllIlIlIlllI for llIlIIllI in llIIIllIlIIlI])
        IllllllIIl = sum([llIlIIllI == IlllllIllIllIIlI for llIlIIllI in llIIIllIlIIlI])
        if IIIIIlIIl > IllllllIIl:
            return IIllIlIlIlllI
        if IIIIIlIIl == IllllllIIl:
            if IlllllIIlIIllII.lIIIllIIlIlIIIIIl:
                return IlllllIllIllIIlI
            else:
                return IIllIlIlIlllI
        return IlllllIllIllIIlI
class llllIlllII(lIllIIlIllIllIIIIIl):
    IIIllIIlIlIlllIlIl = "strategy"
    IlIIIlllllIIIlI = copy.copy(lIllIIlIllIllIIIIIl.IlIIIlllllIIIlI)
    IlIIIlllllIIIlI["memory_depth"] = 10
    def __init__(IlllllIIlIIllII) -> None:
        super().__init__(lIIIIIllllIlIIII=10)