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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: H = None
        self.p: C = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: G = None
        self.p: B = None
        self.t: E = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: G = None
        self.y: A = None
        self.z: F = None
        self.t: F = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: D = None
        self.o: D = None
        self.u: F = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: H = None
        self.q: C = None
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: B = None
        self.o: A = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: B = None
        self.s: C = None
        self.q: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: H = None
        self.p: C = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: G = None
        self.p: B = None
        self.t: E = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: G = None
        self.y: A = None
        self.z: F = None
        self.t: F = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: D = None
        self.o: D = None
        self.u: F = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: H = None
        self.q: C = None
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: B = None
        self.o: A = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: B = None
        self.s: C = None
        self.q: A = None
        self.txt = txt

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

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