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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: D = None
        self.q: H = None
        self.p: I = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.y: H = None
        self.x: D = None
        self.v: E = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: D = None
        self.q: H = None
        self.p: I = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.y: H = None
        self.x: D = None
        self.v: E = None
        self.r: F = None
        self.txt = txt

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

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

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

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