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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: D = None
        self.o: A = None
        self.x: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: C = None
        self.x: B = None
        self.s: D = None
        self.txt = txt

a = A("a")
l = B("l")
d = C("d")
h = D("h")
m = D("m")
f = C("f")
b = C("b")
k = C("k")
n = B("n")

a.v = m
a.t = m
a.u = m
a.o = n
l.z = b
l.w = h
l.o = a
l.x = d
d.x = a
d.z = f
d.v = f
h.r = m
h.s = m
h.q = d
h.x = l
m.r = h
m.s = h
m.q = b
m.x = n
f.x = a
f.z = d
f.v = d
b.x = a
b.z = d
b.v = k
k.x = a
k.z = f
k.v = d
n.z = f
n.w = h
n.o = a
n.x = b
assert f.v.v.x.o.z.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: D = None
        self.o: B = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: D = None
        self.o: A = None
        self.x: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: C = None
        self.x: B = None
        self.s: D = None
        self.txt = txt

a = A("a")
l = B("l")
d = C("d")
h = D("h")
m = D("m")
f = C("f")
b = C("b")
k = C("k")
n = B("n")

a.v = m
a.t = m
a.u = m
a.o = n
l.z = b
l.w = h
l.o = a
l.x = d
d.x = a
d.z = f
d.v = f
h.r = m
h.s = m
h.q = d
h.x = l
m.r = h
m.s = h
m.q = b
m.x = n
f.x = a
f.z = d
f.v = d
b.x = a
b.z = d
b.v = k
k.x = a
k.z = f
k.v = d
n.z = f
n.w = h
n.o = a
n.x = b
assert f.v.v.x.o.z.z.x.txt == "a"