class A:
    def __init__(self, txt: str):
        self.v: I = None
        self.s: B = None
        self.y: F = None
        self.w: D = None
        self.o: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.t: D = None
        self.q: I = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: H = None
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: J = None
        self.u: A = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: J = None
        self.o: E = None
        self.s: D = None
        self.w: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: F = None
        self.w: I = None
        self.t: I = None
        self.u: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.t: D = None
        self.q: I = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: H = None
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: J = None
        self.u: A = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: J = None
        self.o: E = None
        self.s: D = None
        self.w: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: F = None
        self.w: I = None
        self.t: I = None
        self.u: F = None
        self.txt = txt

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

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