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

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: I = None
        self.p: C = None
        self.z: J = None
        self.o: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: B = None
        self.o: J = None
        self.u: C = None
        self.s: E = None
        self.v: C = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.s: B = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: A = None
        self.u: A = None
        self.z: D = None
        self.q: C = None
        self.p: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: A = None
        self.v: B = None
        self.p: I = None
        self.x: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: I = None
        self.p: C = None
        self.z: J = None
        self.o: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: B = None
        self.o: J = None
        self.u: C = None
        self.s: E = None
        self.v: C = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.s: B = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: A = None
        self.u: A = None
        self.z: D = None
        self.q: C = None
        self.p: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: A = None
        self.v: B = None
        self.p: I = None
        self.x: E = None
        self.txt = txt

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

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