class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: H = None
        self.u: E = None
        self.r: G = None
        self.y: E = None
        self.t: A = None
        self.p: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: D = None
        self.u: C = None
        self.v: G = None
        self.x: B = None
        self.z: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: H = None
        self.u: E = None
        self.r: G = None
        self.y: E = None
        self.t: A = None
        self.p: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: D = None
        self.u: C = None
        self.v: G = None
        self.x: B = None
        self.z: D = None
        self.txt = txt

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

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