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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: A = None
        self.z: H = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: E = None
        self.y: H = None
        self.r: D = None
        self.z: E = None
        self.q: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: C = None
        self.o: D = None
        self.t: H = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: A = None
        self.z: H = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: E = None
        self.y: H = None
        self.r: D = None
        self.z: E = None
        self.q: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: C = None
        self.o: D = None
        self.t: H = None
        self.txt = txt

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

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