class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: E = None
        self.x: D = None
        self.u: I = None
        self.y: H = None
        self.v: C = None
        self.r: E = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.p: F = None
        self.o: F = None
        self.t: C = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: F = None
        self.q: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: E = None
        self.u: E = None
        self.t: A = None
        self.r: B = None
        self.q: E = None
        self.v: E = None
        self.w: B = None
        self.z: D = None
        self.s: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.p: F = None
        self.o: F = None
        self.t: C = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: F = None
        self.q: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: E = None
        self.u: E = None
        self.t: A = None
        self.r: B = None
        self.q: E = None
        self.v: E = None
        self.w: B = None
        self.z: D = None
        self.s: G = None
        self.txt = txt

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

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

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