class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: F = None
        self.v: H = None
        self.r: C = None
        self.q: J = None
        self.y: C = None
        self.o: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: H = None
        self.y: E = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: J = None
        self.x: H = None
        self.v: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: B = None
        self.y: F = None
        self.p: I = None
        self.u: D = None
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: J = None
        self.w: J = None
        self.q: G = None
        self.u: A = None
        self.p: H = None
        self.v: I = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: J = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: H = None
        self.y: E = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: J = None
        self.x: H = None
        self.v: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: B = None
        self.y: F = None
        self.p: I = None
        self.u: D = None
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: J = None
        self.w: J = None
        self.q: G = None
        self.u: A = None
        self.p: H = None
        self.v: I = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: J = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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