class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: I = None
        self.r: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: J = None
        self.x: E = None
        self.z: F = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: J = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: G = None
        self.y: D = None
        self.r: I = None
        self.x: D = None
        self.z: C = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: E = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: I = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: J = None
        self.z: D = None
        self.s: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: H = None
        self.t: H = None
        self.s: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: J = None
        self.x: E = None
        self.z: F = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: J = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: G = None
        self.y: D = None
        self.r: I = None
        self.x: D = None
        self.z: C = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: E = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: I = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: J = None
        self.z: D = None
        self.s: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: H = None
        self.t: H = None
        self.s: I = None
        self.txt = txt

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

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