class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: C = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: C = None
        self.w: F = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: A = None
        self.q: D = None
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: B = None
        self.r: B = None
        self.s: E = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: F = None
        self.p: D = None
        self.r: F = None
        self.q: C = None
        self.z: B = None
        self.y: A = None
        self.txt = txt

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

d.w = i
d.z = j
d.q = j
a.t = k
a.w = k
a.q = j
a.x = m
j.u = d
j.t = d
j.q = i
j.y = n
i.p = g
i.s = g
i.y = a
i.r = a
i.u = k
g.q = a
g.r = m
k.x = m
k.r = n
m.y = a
m.t = j
m.s = k
m.v = k
n.s = i
n.p = i
n.x = k
n.r = k
n.q = j
n.z = a
n.y = d
h.q = a
h.r = m
assert j.u.z.u.w.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: C = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: C = None
        self.w: F = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: A = None
        self.q: D = None
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: B = None
        self.r: B = None
        self.s: E = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: F = None
        self.p: D = None
        self.r: F = None
        self.q: C = None
        self.z: B = None
        self.y: A = None
        self.txt = txt

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

d.w = i
d.z = j
d.q = j
a.t = k
a.w = k
a.q = j
a.x = m
j.u = d
j.t = d
j.q = i
j.y = n
i.p = g
i.s = g
i.y = a
i.r = a
i.u = k
g.q = a
g.r = m
k.x = m
k.r = n
m.y = a
m.t = j
m.s = k
m.v = k
n.s = i
n.p = i
n.x = k
n.r = k
n.q = j
n.z = a
n.y = d
h.q = a
h.r = m
assert j.u.z.u.w.y.x.txt == "m"