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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: I = None
        self.r: G = None
        self.q: D = None
        self.v: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: D = None
        self.s: C = None
        self.v: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: F = None
        self.z: G = None
        self.s: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: I = None
        self.r: G = None
        self.q: D = None
        self.v: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: D = None
        self.s: C = None
        self.v: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: F = None
        self.z: G = None
        self.s: A = None
        self.txt = txt

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

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