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

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

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: I = None
        self.s: H = None
        self.p: E = None
        self.r: F = None
        self.v: A = None
        self.o: E = None
        self.z: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: A = None
        self.s: A = None
        self.r: B = None
        self.y: J = None
        self.w: D = None
        self.v: I = None
        self.x: D = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: J = None
        self.z: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: I = None
        self.s: H = None
        self.p: E = None
        self.r: F = None
        self.v: A = None
        self.o: E = None
        self.z: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: A = None
        self.s: A = None
        self.r: B = None
        self.y: J = None
        self.w: D = None
        self.v: I = None
        self.x: D = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: J = None
        self.z: G = None
        self.txt = txt

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

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

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