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

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

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

j = A("j")
a = B("a")
d = C("d")
f = A("f")
e = A("e")
i = C("i")

j.s = d
a.z = e
a.r = d
a.u = d
d.p = i
d.o = i
d.v = a
f.s = d
e.s = d
i.p = d
i.o = d
i.v = a
assert d.v.z.s.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

j = A("j")
a = B("a")
d = C("d")
f = A("f")
e = A("e")
i = C("i")

j.s = d
a.z = e
a.r = d
a.u = d
d.p = i
d.o = i
d.v = a
f.s = d
e.s = d
i.p = d
i.o = d
i.v = a
assert d.v.z.s.v.z.txt == "e"