class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: B = None
        self.u: I = None
        self.p: H = None
        self.y: I = None
        self.w: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: J = None
        self.p: D = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: F = None
        self.x: G = None
        self.t: G = None
        self.z: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: J = None
        self.p: I = None
        self.o: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: J = None
        self.p: D = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: F = None
        self.x: G = None
        self.t: G = None
        self.z: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: J = None
        self.p: I = None
        self.o: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: D = None
        self.txt = txt

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

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