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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: E = None
        self.s: B = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: D = None
        self.r: F = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: E = None
        self.s: B = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: D = None
        self.r: F = None
        self.o: C = None
        self.txt = txt

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

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