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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: E = None
        self.s: A = None
        self.p: I = None
        self.q: D = None
        self.y: F = None
        self.x: A = None
        self.v: G = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: G = None
        self.t: C = None
        self.u: H = None
        self.z: A = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: H = None
        self.y: C = None
        self.v: B = None
        self.p: H = None
        self.r: F = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: A = None
        self.s: I = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: F = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: E = None
        self.s: A = None
        self.p: I = None
        self.q: D = None
        self.y: F = None
        self.x: A = None
        self.v: G = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: G = None
        self.t: C = None
        self.u: H = None
        self.z: A = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: H = None
        self.y: C = None
        self.v: B = None
        self.p: H = None
        self.r: F = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: A = None
        self.s: I = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: F = None
        self.p: B = None
        self.txt = txt

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

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

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