class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: J = None
        self.p: G = None
        self.u: D = None
        self.v: A = None
        self.r: A = None
        self.w: F = None
        self.t: G = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: G = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: J = None
        self.p: G = None
        self.u: D = None
        self.v: A = None
        self.r: A = None
        self.w: F = None
        self.t: G = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: G = None
        self.z: E = None
        self.txt = txt

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

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

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