class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: B = None
        self.r: H = None
        self.t: J = None
        self.x: J = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: I = None
        self.z: G = None
        self.r: A = None
        self.x: J = None
        self.y: B = None
        self.s: A = None
        self.o: F = None
        self.u: I = None
        self.p: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: A = None
        self.s: D = None
        self.v: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: J = None
        self.q: C = None
        self.y: E = None
        self.u: A = None
        self.p: C = None
        self.z: A = None
        self.x: J = None
        self.o: E = None
        self.v: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: H = None
        self.p: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: E = None
        self.z: G = None
        self.t: B = None
        self.w: B = None
        self.r: C = None
        self.q: I = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: I = None
        self.z: G = None
        self.r: A = None
        self.x: J = None
        self.y: B = None
        self.s: A = None
        self.o: F = None
        self.u: I = None
        self.p: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: A = None
        self.s: D = None
        self.v: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: J = None
        self.q: C = None
        self.y: E = None
        self.u: A = None
        self.p: C = None
        self.z: A = None
        self.x: J = None
        self.o: E = None
        self.v: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: H = None
        self.p: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: E = None
        self.z: G = None
        self.t: B = None
        self.w: B = None
        self.r: C = None
        self.q: I = None
        self.txt = txt

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

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