class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: E = None
        self.q: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: A = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: A = None
        self.t: G = None
        self.s: H = None
        self.p: G = None
        self.x: A = None
        self.v: H = None
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: A = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: A = None
        self.t: G = None
        self.s: H = None
        self.p: G = None
        self.x: A = None
        self.v: H = None
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

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

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

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