class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: G = None
        self.x: D = None
        self.t: C = None
        self.p: F = None
        self.v: F = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: H = None
        self.r: F = None
        self.q: H = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: C = None
        self.u: G = None
        self.z: H = None
        self.r: G = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: H = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: F = None
        self.z: B = None
        self.txt = txt

a = A("a")
f = B("f")
d = C("d")
k = D("k")
e = E("e")
m = F("m")
n = G("n")
l = H("l")

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: G = None
        self.x: D = None
        self.t: C = None
        self.p: F = None
        self.v: F = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: H = None
        self.r: F = None
        self.q: H = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: C = None
        self.u: G = None
        self.z: H = None
        self.r: G = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: H = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: F = None
        self.z: B = None
        self.txt = txt

a = A("a")
f = B("f")
d = C("d")
k = D("k")
e = E("e")
m = F("m")
n = G("n")
l = H("l")

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