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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: G = None
        self.p: E = None
        self.y: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: H = None
        self.y: B = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.z: I = None
        self.o: I = None
        self.s: B = None
        self.u: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: F = None
        self.v: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: G = None
        self.p: E = None
        self.y: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: H = None
        self.y: B = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.z: I = None
        self.o: I = None
        self.s: B = None
        self.u: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: F = None
        self.v: A = None
        self.txt = txt

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

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

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