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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: G = None
        self.p: G = None
        self.q: F = None
        self.w: B = None
        self.z: F = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: G = None
        self.p: G = None
        self.q: F = None
        self.w: B = None
        self.z: F = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

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

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

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

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

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

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