class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.w: J = None
        self.t: J = None
        self.z: J = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: E = None
        self.r: G = None
        self.q: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: F = None
        self.q: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: E = None
        self.r: G = None
        self.q: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: F = None
        self.q: D = None
        self.txt = txt

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

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