class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: G = None
        self.y: F = None
        self.v: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: G = None
        self.w: B = None
        self.y: F = None
        self.t: F = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: G = None
        self.t: B = None
        self.x: H = None
        self.q: A = None
        self.z: F = None
        self.w: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: H = None
        self.y: F = None
        self.w: D = None
        self.t: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: G = None
        self.y: F = None
        self.v: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: G = None
        self.w: B = None
        self.y: F = None
        self.t: F = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: G = None
        self.t: B = None
        self.x: H = None
        self.q: A = None
        self.z: F = None
        self.w: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: H = None
        self.y: F = None
        self.w: D = None
        self.t: G = None
        self.txt = txt

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

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