<s>[INST] class Frac:
    def __init__(self, numerator, denominator):
        if denominator == 0:
            raise ValueError("Denominator cannot be zero.")
        self.numerator = numerator
        self.denominator = denominator

    def __repr__(self):
        return f'{self.numerator}/{self.denominator}'

    def __add__(self, other):
        if not isinstance(other, Frac):
            other = Frac(other, 1)
        numerator = self.numerator * other.denominator + self.denominator * other.numerator
        denominator = self.denominator * other.denominator
        return Frac(numerator, denominator)

    def __eq__(self, other):
        if not isinstance(other, Frac):
            other = Frac(other, 1)
        return self.numerator * other.denominator == other.numerator * self.denominator

frac1 = Frac(1, 2)
frac2 = Frac(1, 3)
frac3 = frac1 + 1[/INST]