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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: A = None
        self.r: D = None
        self.v: H = None
        self.s: C = None
        self.p: A = None
        self.x: B = None
        self.txt = txt

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

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

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

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

a.q = b
i.t = a
h.x = n
h.q = m
n.w = j
n.r = a
d.o = m
d.v = m
d.t = k
d.p = k
d.r = n
d.s = h
d.x = i
b.z = l
b.q = k
b.w = a
b.x = m
b.s = d
j.t = n
j.z = b
j.q = l
j.o = i
m.t = b
m.z = n
l.x = n
l.q = m
k.q = b
assert b.z.q.t.w.q.q.q.x.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: A = None
        self.r: D = None
        self.v: H = None
        self.s: C = None
        self.p: A = None
        self.x: B = None
        self.txt = txt

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

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

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

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

a.q = b
i.t = a
h.x = n
h.q = m
n.w = j
n.r = a
d.o = m
d.v = m
d.t = k
d.p = k
d.r = n
d.s = h
d.x = i
b.z = l
b.q = k
b.w = a
b.x = m
b.s = d
j.t = n
j.z = b
j.q = l
j.o = i
m.t = b
m.z = n
l.x = n
l.q = m
k.q = b
assert b.z.q.t.w.q.q.q.x.t.q.txt == "k"