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

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.r: C = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: E = None
        self.o: D = None
        self.q: F = None
        self.s: E = None
        self.p: J = None
        self.z: J = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: J = None
        self.v: J = None
        self.u: H = None
        self.t: G = None
        self.s: A = None
        self.p: G = None
        self.x: B = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: D = None
        self.r: C = None
        self.x: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: C = None
        self.q: D = None
        self.s: F = None
        self.o: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.r: C = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: E = None
        self.o: D = None
        self.q: F = None
        self.s: E = None
        self.p: J = None
        self.z: J = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: J = None
        self.v: J = None
        self.u: H = None
        self.t: G = None
        self.s: A = None
        self.p: G = None
        self.x: B = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: D = None
        self.r: C = None
        self.x: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: C = None
        self.q: D = None
        self.s: F = None
        self.o: C = None
        self.txt = txt

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

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