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

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

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

e = A("e")
d = B("d")
m = C("m")
l = C("l")
b = C("b")
j = A("j")

e.v = l
e.r = d
d.r = m
d.o = e
d.t = e
m.u = d
m.z = d
m.r = d
l.u = d
l.z = d
l.r = d
b.u = d
b.z = d
b.r = d
j.v = l
j.r = d
assert l.u.t.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: B = None
        self.txt = txt

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

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

e = A("e")
d = B("d")
m = C("m")
l = C("l")
b = C("b")
j = A("j")

e.v = l
e.r = d
d.r = m
d.o = e
d.t = e
m.u = d
m.z = d
m.r = d
l.u = d
l.z = d
l.r = d
b.u = d
b.z = d
b.r = d
j.v = l
j.r = d
assert l.u.t.v.u.txt == "d"