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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: E = None
        self.o: A = None
        self.y: F = None
        self.s: J = None
        self.v: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: H = None
        self.w: I = None
        self.x: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: E = None
        self.o: A = None
        self.y: F = None
        self.s: J = None
        self.v: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: H = None
        self.w: I = None
        self.x: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

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