class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: C = None
        self.s: G = None
        self.r: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: D = None
        self.z: H = None
        self.q: H = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: B = None
        self.t: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: G = None
        self.z: D = None
        self.y: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: I = None
        self.w: G = None
        self.r: B = None
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: D = None
        self.z: H = None
        self.q: H = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: B = None
        self.t: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: G = None
        self.z: D = None
        self.y: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: I = None
        self.w: G = None
        self.r: B = None
        self.x: C = None
        self.txt = txt

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

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