class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: A = None
        self.w: G = None
        self.p: G = None
        self.x: E = None
        self.t: H = None
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: F = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: A = None
        self.w: G = None
        self.p: G = None
        self.x: E = None
        self.t: H = None
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: F = None
        self.z: D = None
        self.txt = txt

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

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

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