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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: J = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: A = None
        self.u: E = None
        self.y: H = None
        self.q: E = None
        self.v: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: J = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: A = None
        self.u: E = None
        self.y: H = None
        self.q: E = None
        self.v: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: E = None
        self.txt = txt

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

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

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