class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: D = None
        self.u: F = None
        self.z: B = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.q: H = None
        self.r: H = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.q: H = None
        self.r: H = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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