class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: H = None
        self.r: H = None
        self.u: C = None
        self.p: C = None
        self.o: G = None
        self.q: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: A = None
        self.x: H = None
        self.q: F = None
        self.p: D = None
        self.y: D = None
        self.v: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.y: C = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: D = None
        self.o: E = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: A = None
        self.x: H = None
        self.q: F = None
        self.p: D = None
        self.y: D = None
        self.v: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.y: C = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: D = None
        self.o: E = None
        self.z: E = None
        self.txt = txt

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

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