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

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

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

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

a = A("a")
f = B("f")
b = C("b")
e = D("e")
d = B("d")
j = A("j")
h = A("h")
l = B("l")
m = C("m")

a.s = e
a.t = e
a.y = e
a.o = b
f.y = e
b.o = l
b.t = m
b.r = m
b.z = m
e.v = m
e.z = h
d.y = e
j.s = e
j.t = e
j.y = e
j.o = b
h.s = e
h.t = e
h.y = e
h.o = b
l.y = e
m.o = d
m.t = b
m.r = b
m.z = b
assert m.t.t.r.z.z.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: C = None
        self.t: D = None
        self.y: D = None
        self.txt = txt

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

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

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

a = A("a")
f = B("f")
b = C("b")
e = D("e")
d = B("d")
j = A("j")
h = A("h")
l = B("l")
m = C("m")

a.s = e
a.t = e
a.y = e
a.o = b
f.y = e
b.o = l
b.t = m
b.r = m
b.z = m
e.v = m
e.z = h
d.y = e
j.s = e
j.t = e
j.y = e
j.o = b
h.s = e
h.t = e
h.y = e
h.o = b
l.y = e
m.o = d
m.t = b
m.r = b
m.z = b
assert m.t.t.r.z.z.o.y.txt == "e"