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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: A = None
        self.t: I = None
        self.z: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: G = None
        self.x: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: I = None
        self.r: A = None
        self.v: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: B = None
        self.z: D = None
        self.y: B = None
        self.o: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: A = None
        self.t: I = None
        self.z: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: G = None
        self.x: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: I = None
        self.r: A = None
        self.v: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: B = None
        self.z: D = None
        self.y: B = None
        self.o: B = None
        self.txt = txt

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

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

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