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

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: A = None
        self.q: C = None
        self.txt = txt

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

e = A("e")
d = B("d")
i = C("i")
b = B("b")
l = A("l")
n = C("n")

e.v = l
d.w = b
d.u = e
d.q = i
i.o = b
b.w = d
b.u = l
b.q = n
l.v = e
n.o = b
assert e.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: A = None
        self.q: C = None
        self.txt = txt

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

e = A("e")
d = B("d")
i = C("i")
b = B("b")
l = A("l")
n = C("n")

e.v = l
d.w = b
d.u = e
d.q = i
i.o = b
b.w = d
b.u = l
b.q = n
l.v = e
n.o = b
assert e.v.v.v.v.txt == "e"