class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: B = None
        self.t: B = None
        self.u: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: E = None
        self.y: F = None
        self.v: A = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: E = None
        self.y: F = None
        self.v: A = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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