class A:
    def __init__(self, txt: str):
        self.s: J = None
        self.u: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: J = None
        self.w: E = None
        self.s: J = None
        self.p: F = None
        self.q: F = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: G = None
        self.r: E = None
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: B = None
        self.t: B = None
        self.x: A = None
        self.p: B = None
        self.y: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: H = None
        self.w: J = None
        self.o: C = None
        self.txt = txt

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

f = A("f")
g = B("g")
a = C("a")
b = D("b")
c = E("c")
d = F("d")
n = G("n")
h = H("h")
k = I("k")
m = J("m")

f.s = m
f.u = k
g.t = c
g.r = c
a.u = b
a.t = m
a.s = m
a.w = c
a.p = d
a.q = d
a.o = f
b.q = f
b.y = f
b.z = n
b.r = c
c.r = m
c.z = m
c.t = k
c.u = k
c.w = b
c.s = b
c.o = g
c.q = g
c.y = n
c.x = f
d.z = k
d.q = g
d.t = g
d.p = g
d.x = f
d.y = a
n.u = g
h.p = m
h.q = a
h.x = k
h.y = d
h.t = b
h.w = g
h.z = f
h.o = n
k.r = a
k.o = a
k.t = h
k.w = m
m.y = g
m.q = a
m.x = h
m.z = h
m.p = h
m.s = b
m.t = c
m.u = k
m.v = d
m.r = d
assert d.z.t.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: J = None
        self.u: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: J = None
        self.w: E = None
        self.s: J = None
        self.p: F = None
        self.q: F = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: G = None
        self.r: E = None
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: B = None
        self.t: B = None
        self.x: A = None
        self.p: B = None
        self.y: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: H = None
        self.w: J = None
        self.o: C = None
        self.txt = txt

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

f = A("f")
g = B("g")
a = C("a")
b = D("b")
c = E("c")
d = F("d")
n = G("n")
h = H("h")
k = I("k")
m = J("m")

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