class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: G = None
        self.u: E = None
        self.x: G = None
        self.w: F = None
        self.q: C = None
        self.p: G = None
        self.v: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: F = None
        self.v: B = None
        self.q: F = None
        self.p: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: F = None
        self.v: B = None
        self.q: F = None
        self.p: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: A = None
        self.txt = txt

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

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

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