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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: C = None
        self.u: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: B = None
        self.s: B = None
        self.o: F = None
        self.r: B = None
        self.p: F = None
        self.w: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: C = None
        self.u: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: B = None
        self.s: B = None
        self.o: F = None
        self.r: B = None
        self.p: F = None
        self.w: F = None
        self.txt = txt

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

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

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