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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: F = None
        self.u: H = None
        self.v: E = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: A = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: F = None
        self.u: H = None
        self.v: E = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: A = None
        self.o: C = None
        self.txt = txt

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

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