class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: G = None
        self.s: E = None
        self.v: I = None
        self.r: I = None
        self.p: G = None
        self.t: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: B = None
        self.x: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: G = None
        self.s: E = None
        self.v: I = None
        self.r: I = None
        self.p: G = None
        self.t: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: B = None
        self.x: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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