class A:
    def __init__(self, txt: str):
        self.p: J = None
        self.r: H = None
        self.w: F = None
        self.z: J = None
        self.t: F = None
        self.q: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: J = None
        self.z: B = None
        self.s: B = None
        self.q: E = None
        self.x: E = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: G = None
        self.s: J = None
        self.u: C = None
        self.r: B = None
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: J = None
        self.o: C = None
        self.p: D = None
        self.w: E = None
        self.t: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: G = None
        self.w: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: J = None
        self.z: B = None
        self.s: B = None
        self.q: E = None
        self.x: E = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: G = None
        self.s: J = None
        self.u: C = None
        self.r: B = None
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: J = None
        self.o: C = None
        self.p: D = None
        self.w: E = None
        self.t: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: G = None
        self.w: F = None
        self.txt = txt

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

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