class A:
    def __init__(self, txt: str):
        self.y: J = None
        self.r: H = None
        self.w: J = None
        self.v: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: J = None
        self.x: E = None
        self.z: I = None
        self.w: J = None
        self.s: J = None
        self.u: H = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: A = None
        self.w: D = None
        self.o: C = None
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.q: C = None
        self.s: F = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: H = None
        self.r: F = None
        self.t: I = None
        self.x: A = None
        self.z: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: J = None
        self.x: E = None
        self.z: I = None
        self.w: J = None
        self.s: J = None
        self.u: H = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: A = None
        self.w: D = None
        self.o: C = None
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.q: C = None
        self.s: F = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: H = None
        self.r: F = None
        self.t: I = None
        self.x: A = None
        self.z: E = None
        self.txt = txt

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

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