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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: G = None
        self.r: A = None
        self.s: D = None
        self.q: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: A = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: G = None
        self.q: B = None
        self.t: H = None
        self.v: A = None
        self.w: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: G = None
        self.r: A = None
        self.s: D = None
        self.q: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: A = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: G = None
        self.q: B = None
        self.t: H = None
        self.v: A = None
        self.w: G = None
        self.txt = txt

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

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

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

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