class A:
    def __init__(self, txt: str):
        self.s: I = None
        self.u: D = None
        self.q: G = None
        self.r: B = None
        self.z: G = None
        self.v: B = None
        self.t: G = None
        self.p: E = None
        self.y: H = None
        self.o: J = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: I = None
        self.x: F = None
        self.t: B = None
        self.z: E = None
        self.w: B = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: B = None
        self.w: H = None
        self.u: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: F = None
        self.z: J = None
        self.v: E = None
        self.p: F = None
        self.q: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: I = None
        self.txt = txt

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

f.s = e
f.u = a
f.q = n
f.z = n
f.t = n
f.r = g
f.v = g
f.p = l
f.y = k
f.o = m
g.x = a
g.y = e
g.z = n
g.w = l
c.r = g
c.t = g
c.w = g
c.q = e
c.x = d
c.z = l
c.s = a
a.y = d
a.x = g
a.w = k
a.u = l
l.o = g
l.p = a
d.o = g
n.w = l
n.v = l
n.r = d
n.p = d
n.z = m
n.q = c
k.q = l
e.x = l
m.w = k
m.o = e
assert c.z.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: I = None
        self.u: D = None
        self.q: G = None
        self.r: B = None
        self.z: G = None
        self.v: B = None
        self.t: G = None
        self.p: E = None
        self.y: H = None
        self.o: J = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: I = None
        self.x: F = None
        self.t: B = None
        self.z: E = None
        self.w: B = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: B = None
        self.w: H = None
        self.u: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: F = None
        self.z: J = None
        self.v: E = None
        self.p: F = None
        self.q: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: I = None
        self.txt = txt

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

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