class Mentor():
    def __init__(self):
        self._student = None

    def getStudent(self):
        return self._student

    def hasStudent(self):
        has = not (self._student is None)
        return has

    def setStudent(self, aNewStudent):
        wasSet = False
        if aNewStudent is None :
            existingStudent = self._student
            self._student = None
            if not (existingStudent is None) and not (existingStudent.getMentor() is None) :
                existingStudent.setMentor(None)
            wasSet = True
            return wasSet
        currentStudent = self.getStudent()
        if not (currentStudent is None) and not currentStudent == aNewStudent :
            currentStudent.setMentor(None)
        self._student = aNewStudent
        existingMentor = aNewStudent.getMentor()
        if not self == existingMentor :
            aNewStudent.setMentor(self)
        wasSet = True
        return wasSet

    def delete(self):
        if not (self._student is None) :
            self._student.setMentor(None)


class Student():
    def __init__(self):
        self._mentor = None

    def getMentor(self):
        return self._mentor

    def hasMentor(self):
        has = not (self._mentor is None)
        return has

    def setMentor(self, aNewMentor):
        wasSet = False
        if aNewMentor is None :
            existingMentor = self._mentor
            self._mentor = None
            if not (existingMentor is None) and not (existingMentor.getStudent() is None) :
                existingMentor.setStudent(None)
            wasSet = True
            return wasSet
        currentMentor = self.getMentor()
        if not (currentMentor is None) and not currentMentor == aNewMentor :
            currentMentor.setStudent(None)
        self._mentor = aNewMentor
        existingStudent = aNewMentor.getStudent()
        if not self == existingStudent :
            aNewMentor.setStudent(self)
        wasSet = True
        return wasSet

    def delete(self):
        if not (self._mentor is None) :
            self._mentor.setStudent(None)