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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: E = None
        self.z: F = None
        self.q: F = None
        self.y: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: E = None
        self.z: F = None
        self.q: F = None
        self.y: H = None
        self.txt = txt

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

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

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

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

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

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

i.u = n
d.z = n
d.t = h
c.s = d
c.v = a
c.z = j
c.q = j
c.y = n
h.y = g
h.o = g
h.s = c
h.w = j
h.q = j
h.x = i
h.v = b
a.s = i
j.z = c
g.w = d
g.z = i
g.x = n
g.s = h
g.q = h
g.y = a
g.t = j
n.w = i
n.r = d
n.t = g
b.s = i
assert a.s.u.w.u.w.txt == "i"