class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: I = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: H = None
        self.y: A = None
        self.t: H = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.p: C = None
        self.r: B = None
        self.q: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: C = None
        self.y: C = None
        self.s: G = None
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: G = None
        self.t: F = None
        self.u: C = None
        self.x: G = None
        self.p: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: F = None
        self.p: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: H = None
        self.y: A = None
        self.t: H = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.p: C = None
        self.r: B = None
        self.q: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: C = None
        self.y: C = None
        self.s: G = None
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: G = None
        self.t: F = None
        self.u: C = None
        self.x: G = None
        self.p: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: F = None
        self.p: F = None
        self.txt = txt

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

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