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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: D = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: J = None
        self.r: J = None
        self.u: A = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.v: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: B = None
        self.z: A = None
        self.p: C = None
        self.t: A = None
        self.q: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: D = None
        self.p: C = None
        self.u: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: D = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: J = None
        self.r: J = None
        self.u: A = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.v: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: B = None
        self.z: A = None
        self.p: C = None
        self.t: A = None
        self.q: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: D = None
        self.p: C = None
        self.u: A = None
        self.txt = txt

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

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