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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: G = None
        self.v: A = None
        self.w: B = None
        self.r: E = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: A = None
        self.z: A = None
        self.r: D = None
        self.s: D = None
        self.t: E = None
        self.x: E = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: H = None
        self.t: A = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: C = None
        self.u: C = None
        self.z: B = None
        self.s: C = None
        self.y: C = None
        self.o: G = None
        self.t: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: G = None
        self.v: A = None
        self.w: B = None
        self.r: E = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: A = None
        self.z: A = None
        self.r: D = None
        self.s: D = None
        self.t: E = None
        self.x: E = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: H = None
        self.t: A = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: C = None
        self.u: C = None
        self.z: B = None
        self.s: C = None
        self.y: C = None
        self.o: G = None
        self.t: B = None
        self.txt = txt

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

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