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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: E = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: G = None
        self.u: G = None
        self.w: D = None
        self.t: H = None
        self.v: A = None
        self.q: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: H = None
        self.s: I = None
        self.x: A = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: J = None
        self.o: J = None
        self.q: E = None
        self.u: H = None
        self.z: E = None
        self.w: B = None
        self.t: F = None
        self.p: D = 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: G = None
        self.s: G = None
        self.z: C = None
        self.p: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: D = None
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: E = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: G = None
        self.u: G = None
        self.w: D = None
        self.t: H = None
        self.v: A = None
        self.q: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: H = None
        self.s: I = None
        self.x: A = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: J = None
        self.o: J = None
        self.q: E = None
        self.u: H = None
        self.z: E = None
        self.w: B = None
        self.t: F = None
        self.p: D = 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: G = None
        self.s: G = None
        self.z: C = None
        self.p: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: D = None
        self.x: D = None
        self.txt = txt

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

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