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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: B = None
        self.p: B = None
        self.q: A = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: F = None
        self.q: E = None
        self.w: G = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: B = None
        self.x: C = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: D = None
        self.x: C = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

e = A("e")
h = B("h")
a = C("a")
b = D("b")
g = E("g")
f = F("f")
d = G("d")
i = A("i")

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: B = None
        self.p: B = None
        self.q: A = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: F = None
        self.q: E = None
        self.w: G = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: B = None
        self.x: C = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: D = None
        self.x: C = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

e = A("e")
h = B("h")
a = C("a")
b = D("b")
g = E("g")
f = F("f")
d = G("d")
i = A("i")

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