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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: A = None
        self.r: H = None
        self.y: H = None
        self.o: A = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: A = None
        self.u: A = None
        self.r: G = None
        self.p: E = None
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: C = None
        self.z: H = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: C = None
        self.z: B = None
        self.r: D = None
        self.y: H = None
        self.s: H = None
        self.o: D = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: C = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: B = None
        self.z: F = None
        self.q: C = None
        self.v: E = None
        self.w: D = None
        self.txt = txt

n = A("n")
i = B("i")
m = C("m")
f = D("f")
c = E("c")
j = F("j")
a = G("a")
l = H("l")

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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: A = None
        self.r: H = None
        self.y: H = None
        self.o: A = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: A = None
        self.u: A = None
        self.r: G = None
        self.p: E = None
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: C = None
        self.z: H = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: C = None
        self.z: B = None
        self.r: D = None
        self.y: H = None
        self.s: H = None
        self.o: D = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: C = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: B = None
        self.z: F = None
        self.q: C = None
        self.v: E = None
        self.w: D = None
        self.txt = txt

n = A("n")
i = B("i")
m = C("m")
f = D("f")
c = E("c")
j = F("j")
a = G("a")
l = H("l")

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