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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: H = None
        self.z: B = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: A = None
        self.t: E = None
        self.z: D = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: I = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: H = None
        self.z: B = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: A = None
        self.t: E = None
        self.z: D = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: I = None
        self.txt = txt

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

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