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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: F = None
        self.u: F = None
        self.v: H = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: F = None
        self.u: F = None
        self.v: H = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

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

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

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