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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: I = None
        self.q: E = None
        self.s: D = None
        self.y: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: J = None
        self.u: J = None
        self.r: I = None
        self.q: B = None
        self.t: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: A = None
        self.s: C = None
        self.u: C = None
        self.q: A = None
        self.r: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: I = None
        self.q: E = None
        self.s: D = None
        self.y: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: J = None
        self.u: J = None
        self.r: I = None
        self.q: B = None
        self.t: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: A = None
        self.s: C = None
        self.u: C = None
        self.q: A = None
        self.r: A = None
        self.txt = txt

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

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