class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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