from typing import Dict


def __attempt_replace(line_args: str, labels_locs: Dict[str, int]) -> str:
    """
    Atttempt to replace a label with its memory address.
    :param line_args: Part of the line including the arguments.
    :param labels_locs: Labels and their memory addresses.
    :return: Line with the label replaced to its memory address.
    """
    for label in labels_locs:
        if label in line_args:
            line_args = line_args.replace(label, f"{labels_locs[label]:02X}h")
            return line_args
    return line_args