class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: J = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: I = None
        self.r: G = None
        self.s: A = None
        self.x: F = None
        self.q: A = None
        self.p: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: F = None
        self.y: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: D = None
        self.t: G = None
        self.x: E = None
        self.u: I = None
        self.txt = txt

b = A("b")
g = B("g")
n = C("n")
f = D("f")
h = E("h")
m = F("m")
e = G("e")
l = H("l")
i = I("i")
d = J("d")

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

class B:
    def __init__(self, txt: str):
        self.s: J = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: I = None
        self.r: G = None
        self.s: A = None
        self.x: F = None
        self.q: A = None
        self.p: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: F = None
        self.y: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: D = None
        self.t: G = None
        self.x: E = None
        self.u: I = None
        self.txt = txt

b = A("b")
g = B("g")
n = C("n")
f = D("f")
h = E("h")
m = F("m")
e = G("e")
l = H("l")
i = I("i")
d = J("d")

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