from typing import overload, TypeVar, Generic


@overload
def f(key: int) -> int: ...
@overload
def f(key: str) -> str: ...


def g(x: dict) -> None: ...


@overload
def stub_only(x: int) -> int: ...
@overload
def stub_only(x: str) -> str: ...


class C:
    @overload
    def __getitem__(self, key: int) -> int: ...
    @overload
    def __getitem__(self, key: str) -> str: ...

    @overload
    def __add__(self, other: int) -> int: ...
    @overload
    def __add__(self, other: str) -> str: ...


T = TypeVar('T')


class Gen(Generic[T]):
    def __init__(self, x: T): ...
    @overload
    def get(self, x: int, y: T) -> T: ...
    @overload
    def get(self, x: str, y: T) -> T: ...
