class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: C = None
        self.s: F = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: A = None
        self.r: B = None
        self.u: G = None
        self.o: D = None
        self.p: I = None
        self.w: I = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.z: H = None
        self.q: F = None
        self.r: C = None
        self.o: E = None
        self.y: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: J = None
        self.w: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: C = None
        self.p: I = None
        self.r: G = None
        self.t: E = None
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: A = None
        self.r: B = None
        self.u: G = None
        self.o: D = None
        self.p: I = None
        self.w: I = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.z: H = None
        self.q: F = None
        self.r: C = None
        self.o: E = None
        self.y: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: J = None
        self.w: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: C = None
        self.p: I = None
        self.r: G = None
        self.t: E = None
        self.x: D = None
        self.txt = txt

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

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