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

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

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: G = None
        self.q: J = None
        self.v: G = None
        self.p: H = None
        self.z: G = None
        self.w: I = None
        self.u: F = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: F = None
        self.o: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.s: H = None
        self.p: A = None
        self.o: H = None
        self.t: I = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: H = None
        self.p: A = None
        self.w: D = None
        self.z: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: E = None
        self.v: I = None
        self.x: G = None
        self.s: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: G = None
        self.q: J = None
        self.v: G = None
        self.p: H = None
        self.z: G = None
        self.w: I = None
        self.u: F = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: F = None
        self.o: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.s: H = None
        self.p: A = None
        self.o: H = None
        self.t: I = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: H = None
        self.p: A = None
        self.w: D = None
        self.z: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: E = None
        self.v: I = None
        self.x: G = None
        self.s: C = None
        self.txt = txt

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

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