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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: I = None
        self.p: J = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: D = None
        self.s: J = None
        self.r: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: G = None
        self.y: A = None
        self.x: G = None
        self.s: F = None
        self.v: J = None
        self.t: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: B = None
        self.t: I = None
        self.p: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: I = None
        self.p: J = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: D = None
        self.s: J = None
        self.r: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: G = None
        self.y: A = None
        self.x: G = None
        self.s: F = None
        self.v: J = None
        self.t: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: B = None
        self.t: I = None
        self.p: C = None
        self.txt = txt

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

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