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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: G = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: C = None
        self.v: I = None
        self.t: C = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: G = None
        self.q: A = None
        self.t: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: G = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: C = None
        self.v: I = None
        self.t: C = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: G = None
        self.q: A = None
        self.t: B = None
        self.txt = txt

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

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