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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: F = None
        self.r: D = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: G = None
        self.z: D = None
        self.v: B = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: A = None
        self.z: B = None
        self.t: G = None
        self.y: F = None
        self.s: D = None
        self.w: B = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: F = None
        self.x: E = None
        self.t: C = None
        self.s: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: F = None
        self.r: D = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: G = None
        self.z: D = None
        self.v: B = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: A = None
        self.z: B = None
        self.t: G = None
        self.y: F = None
        self.s: D = None
        self.w: B = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: F = None
        self.x: E = None
        self.t: C = None
        self.s: H = None
        self.txt = txt

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

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