class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: F = None
        self.u: G = None
        self.p: J = None
        self.q: B = None
        self.v: G = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: G = None
        self.r: J = None
        self.y: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: G = None
        self.x: E = None
        self.t: C = None
        self.r: D = None
        self.o: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: D = None
        self.v: B = None
        self.q: G = None
        self.w: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: G = None
        self.r: J = None
        self.y: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: G = None
        self.x: E = None
        self.t: C = None
        self.r: D = None
        self.o: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: D = None
        self.v: B = None
        self.q: G = None
        self.w: F = None
        self.txt = txt

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

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

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