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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: E = None
        self.y: C = None
        self.q: E = None
        self.u: I = None
        self.o: I = None
        self.s: D = None
        self.w: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: C = None
        self.x: D = None
        self.u: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: E = None
        self.y: C = None
        self.q: E = None
        self.u: I = None
        self.o: I = None
        self.s: D = None
        self.w: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: C = None
        self.x: D = None
        self.u: B = None
        self.txt = txt

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

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

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