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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: I = None
        self.z: C = None
        self.s: I = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: F = None
        self.x: D = None
        self.o: H = None
        self.r: I = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: B = None
        self.y: A = None
        self.z: D = None
        self.w: C = None
        self.q: H = None
        self.t: G = None
        self.r: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: I = None
        self.z: C = None
        self.s: I = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: F = None
        self.x: D = None
        self.o: H = None
        self.r: I = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: B = None
        self.y: A = None
        self.z: D = None
        self.w: C = None
        self.q: H = None
        self.t: G = None
        self.r: B = None
        self.txt = txt

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

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