class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: D = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: D = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: B = None
        self.txt = txt

e = A("e")
i = B("i")
l = C("l")
n = D("n")

e.p = n
i.y = l
i.r = l
i.u = n
l.p = e
l.t = n
l.r = i
l.y = i
n.o = i
n.v = i
assert i.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: D = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: D = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: B = None
        self.txt = txt

e = A("e")
i = B("i")
l = C("l")
n = D("n")

e.p = n
i.y = l
i.r = l
i.u = n
l.p = e
l.t = n
l.r = i
l.y = i
n.o = i
n.v = i
assert i.y.y.y.txt == "l"