class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: E = None
        self.s: H = None
        self.t: C = None
        self.z: C = None
        self.o: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: J = None
        self.s: D = None
        self.x: J = None
        self.v: B = None
        self.w: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: A = None
        self.x: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: I = None
        self.w: F = None
        self.r: F = None
        self.p: B = None
        self.q: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: J = None
        self.s: D = None
        self.x: J = None
        self.v: B = None
        self.w: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: A = None
        self.x: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: I = None
        self.w: F = None
        self.r: F = None
        self.p: B = None
        self.q: E = None
        self.txt = txt

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

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