class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: C = None
        self.u: E = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: E = None
        self.w: A = None
        self.y: A = None
        self.z: C = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: D = None
        self.r: F = None
        self.u: D = None
        self.z: C = None
        self.w: F = None
        self.txt = txt

m = A("m")
d = B("d")
f = C("f")
h = D("h")
n = E("n")
e = F("e")
l = F("l")
c = E("c")
k = B("k")

m.z = l
m.w = f
m.s = f
m.u = n
d.o = k
d.v = n
d.w = m
d.y = m
d.z = f
d.u = l
f.o = l
h.o = n
h.s = n
h.w = f
h.z = m
n.z = e
e.x = c
e.y = h
e.u = h
e.r = l
e.w = l
e.z = f
l.x = c
l.y = h
l.u = h
l.r = e
l.w = e
l.z = f
c.z = e
k.o = d
k.v = n
k.w = m
k.y = m
k.z = f
k.u = e
assert m.u.z.x.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: C = None
        self.u: E = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: E = None
        self.w: A = None
        self.y: A = None
        self.z: C = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: D = None
        self.r: F = None
        self.u: D = None
        self.z: C = None
        self.w: F = None
        self.txt = txt

m = A("m")
d = B("d")
f = C("f")
h = D("h")
n = E("n")
e = F("e")
l = F("l")
c = E("c")
k = B("k")

m.z = l
m.w = f
m.s = f
m.u = n
d.o = k
d.v = n
d.w = m
d.y = m
d.z = f
d.u = l
f.o = l
h.o = n
h.s = n
h.w = f
h.z = m
n.z = e
e.x = c
e.y = h
e.u = h
e.r = l
e.w = l
e.z = f
l.x = c
l.y = h
l.u = h
l.r = e
l.w = e
l.z = f
c.z = e
k.o = d
k.v = n
k.w = m
k.y = m
k.z = f
k.u = e
assert m.u.z.x.z.y.txt == "h"