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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: B = None
        self.v: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: D = None
        self.t: C = None
        self.q: J = None
        self.r: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: F = None
        self.r: D = None
        self.z: A = None
        self.p: D = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: B = None
        self.v: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: D = None
        self.t: C = None
        self.q: J = None
        self.r: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: F = None
        self.r: D = None
        self.z: A = None
        self.p: D = None
        self.u: C = None
        self.txt = txt

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

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

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