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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.z: A = None
        self.v: G = None
        self.r: F = None
        self.x: H = None
        self.o: D = None
        self.s: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: H = None
        self.p: G = None
        self.w: A = None
        self.q: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.z: A = None
        self.v: G = None
        self.r: F = None
        self.x: H = None
        self.o: D = None
        self.s: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: H = None
        self.p: G = None
        self.w: A = None
        self.q: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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