class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: F = None
        self.t: H = None
        self.s: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: H = None
        self.x: G = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: E = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: E = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: C = None
        self.u: A = None
        self.z: F = None
        self.q: C = None
        self.txt = txt

h = A("h")
e = B("e")
d = C("d")
k = D("k")
j = E("j")
g = F("g")
m = G("m")
f = H("f")
a = H("a")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: H = None
        self.x: G = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: E = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: E = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: C = None
        self.u: A = None
        self.z: F = None
        self.q: C = None
        self.txt = txt

h = A("h")
e = B("e")
d = C("d")
k = D("k")
j = E("j")
g = F("g")
m = G("m")
f = H("f")
a = H("a")

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