class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: E = None
        self.o: D = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: E = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

j.y = b
j.s = b
j.p = b
j.o = g
a.z = n
a.w = b
a.o = g
h.u = b
e.t = n
b.z = m
b.o = m
n.z = a
m.y = h
c.y = b
c.s = h
g.t = n
assert n.z.w.o.y.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: E = None
        self.o: D = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: E = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

j.y = b
j.s = b
j.p = b
j.o = g
a.z = n
a.w = b
a.o = g
h.u = b
e.t = n
b.z = m
b.o = m
n.z = a
m.y = h
c.y = b
c.s = h
g.t = n
assert n.z.w.o.y.u.z.txt == "m"