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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: C = None
        self.z: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: G = None
        self.s: B = None
        self.z: A = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: C = None
        self.z: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: G = None
        self.s: B = None
        self.z: A = None
        self.u: E = None
        self.txt = txt

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

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