class A:
    def __init__(self, txt: str):
        self.w: I = None
        self.q: C = None
        self.z: F = None
        self.v: J = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: A = None
        self.t: A = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: E = None
        self.t: J = None
        self.v: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: F = None
        self.r: G = None
        self.p: J = None
        self.o: J = None
        self.v: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: A = None
        self.t: A = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: E = None
        self.t: J = None
        self.v: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: F = None
        self.r: G = None
        self.p: J = None
        self.o: J = None
        self.v: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

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

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