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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: D = None
        self.y: F = None
        self.txt = txt

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

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

n.w = d
e.z = a
e.q = h
h.w = d
h.x = l
h.y = l
h.s = g
h.p = g
g.p = n
g.s = n
g.z = l
g.w = l
g.q = a
g.u = a
g.v = d
d.v = e
d.y = f
d.z = h
d.o = h
d.w = h
d.t = n
a.v = e
a.x = e
f.z = e
f.u = g
f.y = a
l.t = d
c.w = d
assert a.x.q.w.t.w.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: D = None
        self.y: F = None
        self.txt = txt

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

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

n.w = d
e.z = a
e.q = h
h.w = d
h.x = l
h.y = l
h.s = g
h.p = g
g.p = n
g.s = n
g.z = l
g.w = l
g.q = a
g.u = a
g.v = d
d.v = e
d.y = f
d.z = h
d.o = h
d.w = h
d.t = n
a.v = e
a.x = e
f.z = e
f.u = g
f.y = a
l.t = d
c.w = d
assert a.x.q.w.t.w.y.y.txt == "a"