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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: B = None
        self.y: B = None
        self.u: I = None
        self.p: J = None
        self.w: E = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: B = None
        self.y: B = None
        self.u: I = None
        self.p: J = None
        self.w: E = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: F = None
        self.txt = txt

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

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

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

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