class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: J = None
        self.s: D = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: H = None
        self.r: F = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: J = None
        self.t: A = None
        self.z: H = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: H = None
        self.o: F = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: G = None
        self.w: C = None
        self.z: J = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: J = None
        self.s: D = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: H = None
        self.r: F = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: J = None
        self.t: A = None
        self.z: H = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: H = None
        self.o: F = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: G = None
        self.w: C = None
        self.z: J = None
        self.txt = txt

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

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

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

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