class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: H = None
        self.w: G = None
        self.t: H = None
        self.o: B = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: H = None
        self.o: F = None
        self.t: D = None
        self.z: I = None
        self.s: I = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: A = None
        self.y: H = None
        self.s: I = None
        self.u: J = None
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: B = None
        self.r: E = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: G = None
        self.o: C = None
        self.q: D = None
        self.x: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: H = None
        self.o: F = None
        self.t: D = None
        self.z: I = None
        self.s: I = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: A = None
        self.y: H = None
        self.s: I = None
        self.u: J = None
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: B = None
        self.r: E = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: G = None
        self.o: C = None
        self.q: D = None
        self.x: B = None
        self.txt = txt

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

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