from dataclasses import dataclass


@dataclass(frozen=True, order=True, repr=True)
class Person:
    """
    An object representing a person. The contructor must be given their
    last name and first name (both strings).
    """

    lname: str
    fname: str

    def __str__(self) -> str:
        """
        Produce the representation of the object that's used when it's
        printed by itself.
        """
        return self.lname + ", " + self.fname

    def lastname(self):
        """
        Return the person's last name.
        """
        return self.lname

    def firstname(self):
        """
        Return the person's first name.
        """
        return self.fname
