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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: D = None
        self.v: I = None
        self.x: H = None
        self.q: I = None
        self.s: F = None
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: F = None
        self.s: D = None
        self.t: D = None
        self.w: C = None
        self.v: A = None
        self.z: D = None
        self.o: F = None
        self.txt = txt

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

a = A("a")
j = B("j")
k = C("k")
n = D("n")
f = E("f")
m = F("m")
g = G("g")
h = H("h")
i = I("i")
b = J("b")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: D = None
        self.v: I = None
        self.x: H = None
        self.q: I = None
        self.s: F = None
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: F = None
        self.s: D = None
        self.t: D = None
        self.w: C = None
        self.v: A = None
        self.z: D = None
        self.o: F = None
        self.txt = txt

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

a = A("a")
j = B("j")
k = C("k")
n = D("n")
f = E("f")
m = F("m")
g = G("g")
h = H("h")
i = I("i")
b = J("b")

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