class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: B = None
        self.y: A = None
        self.z: B = None
        self.w: F = None
        self.p: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: H = None
        self.r: B = None
        self.x: F = None
        self.p: H = None
        self.o: C = None
        self.w: B = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.y: C = None
        self.q: D = None
        self.t: H = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: B = None
        self.y: A = None
        self.z: B = None
        self.w: F = None
        self.p: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: H = None
        self.r: B = None
        self.x: F = None
        self.p: H = None
        self.o: C = None
        self.w: B = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.y: C = None
        self.q: D = None
        self.t: H = None
        self.txt = txt

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

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

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

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

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