class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.z: I = None
        self.u: F = None
        self.o: H = None
        self.q: C = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: F = None
        self.z: D = None
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: H = None
        self.t: I = None
        self.p: B = None
        self.s: B = None
        self.q: C = None
        self.x: D = None
        self.u: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: H = None
        self.x: E = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: F = None
        self.r: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: F = None
        self.z: D = None
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: H = None
        self.t: I = None
        self.p: B = None
        self.s: B = None
        self.q: C = None
        self.x: D = None
        self.u: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: H = None
        self.x: E = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: F = None
        self.r: I = None
        self.txt = txt

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

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