class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: F = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: A = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: B = None
        self.p: H = None
        self.o: A = None
        self.txt = txt

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

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

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

m = A("m")
n = B("n")
c = C("c")
e = D("e")
b = E("b")
d = F("d")
a = G("a")
f = H("f")

m.y = f
n.z = f
c.p = b
c.o = d
c.x = m
e.t = n
e.x = m
e.w = m
b.u = a
b.y = n
b.p = f
b.o = m
d.o = f
d.w = n
a.o = f
a.u = n
a.s = m
f.o = b
f.q = n
assert c.p.u.u.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: F = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: A = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: B = None
        self.p: H = None
        self.o: A = None
        self.txt = txt

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

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

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

m = A("m")
n = B("n")
c = C("c")
e = D("e")
b = E("b")
d = F("d")
a = G("a")
f = H("f")

m.y = f
n.z = f
c.p = b
c.o = d
c.x = m
e.t = n
e.x = m
e.w = m
b.u = a
b.y = n
b.p = f
b.o = m
d.o = f
d.w = n
a.o = f
a.u = n
a.s = m
f.o = b
f.q = n
assert c.p.u.u.z.q.txt == "n"