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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: E = None
        self.w: D = None
        self.r: C = None
        self.v: D = None
        self.t: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: C = None
        self.s: F = None
        self.t: G = None
        self.y: C = None
        self.w: B = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: G = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: E = None
        self.x: F = None
        self.s: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: F = None
        self.o: A = None
        self.p: E = None
        self.txt = txt

m = A("m")
i = B("i")
a = C("a")
l = D("l")
g = E("g")
h = F("h")
b = G("b")
d = H("d")

m.w = a
i.y = m
i.o = g
i.w = l
i.v = l
i.t = l
i.r = a
a.o = l
a.p = i
a.u = g
l.z = g
g.x = d
g.q = a
g.y = a
g.s = h
g.t = b
g.w = i
g.p = m
h.x = b
h.w = b
h.r = b
b.q = h
b.x = h
b.y = g
b.s = l
d.u = g
d.p = g
d.t = h
d.o = m
assert b.q.r.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: E = None
        self.w: D = None
        self.r: C = None
        self.v: D = None
        self.t: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: C = None
        self.s: F = None
        self.t: G = None
        self.y: C = None
        self.w: B = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: G = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: E = None
        self.x: F = None
        self.s: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: F = None
        self.o: A = None
        self.p: E = None
        self.txt = txt

m = A("m")
i = B("i")
a = C("a")
l = D("l")
g = E("g")
h = F("h")
b = G("b")
d = H("d")

m.w = a
i.y = m
i.o = g
i.w = l
i.v = l
i.t = l
i.r = a
a.o = l
a.p = i
a.u = g
l.z = g
g.x = d
g.q = a
g.y = a
g.s = h
g.t = b
g.w = i
g.p = m
h.x = b
h.w = b
h.r = b
b.q = h
b.x = h
b.y = g
b.s = l
d.u = g
d.p = g
d.t = h
d.o = m
assert b.q.r.s.txt == "l"