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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: E = None
        self.q: C = None
        self.r: B = None
        self.o: I = None
        self.v: D = None
        self.s: D = None
        self.t: F = None
        self.p: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: B = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: E = None
        self.q: C = None
        self.r: B = None
        self.o: I = None
        self.v: D = None
        self.s: D = None
        self.t: F = None
        self.p: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: B = None
        self.o: A = None
        self.txt = txt

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

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