class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: H = None
        self.q: G = None
        self.w: J = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: J = None
        self.v: H = None
        self.t: I = None
        self.q: G = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: J = None
        self.q: B = None
        self.v: B = None
        self.o: J = None
        self.y: H = None
        self.p: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: G = None
        self.v: B = None
        self.q: E = None
        self.z: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: F = None
        self.q: A = None
        self.w: H = None
        self.t: I = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: J = None
        self.v: H = None
        self.t: I = None
        self.q: G = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: J = None
        self.q: B = None
        self.v: B = None
        self.o: J = None
        self.y: H = None
        self.p: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: G = None
        self.v: B = None
        self.q: E = None
        self.z: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: F = None
        self.q: A = None
        self.w: H = None
        self.t: I = None
        self.txt = txt

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

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