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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: J = None
        self.v: F = None
        self.s: E = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: I = None
        self.x: J = None
        self.y: I = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.p: G = None
        self.u: C = None
        self.z: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: G = None
        self.v: E = None
        self.p: H = None
        self.y: E = None
        self.q: E = None
        self.o: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: J = None
        self.v: F = None
        self.s: E = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: I = None
        self.x: J = None
        self.y: I = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.p: G = None
        self.u: C = None
        self.z: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: G = None
        self.v: E = None
        self.p: H = None
        self.y: E = None
        self.q: E = None
        self.o: F = None
        self.txt = txt

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

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