class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: C = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: F = None
        self.s: D = None
        self.t: E = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: F = None
        self.s: D = None
        self.t: E = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

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

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