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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: B = None
        self.u: I = None
        self.y: D = None
        self.t: E = None
        self.q: A = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: H = None
        self.u: E = None
        self.y: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: D = None
        self.z: F = None
        self.y: H = None
        self.s: C = None
        self.w: I = None
        self.x: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: B = None
        self.u: I = None
        self.y: D = None
        self.t: E = None
        self.q: A = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: H = None
        self.u: E = None
        self.y: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: D = None
        self.z: F = None
        self.y: H = None
        self.s: C = None
        self.w: I = None
        self.x: E = None
        self.txt = txt

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

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