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

class B:
    def __init__(self, txt: str):
        self.z: J = None
        self.t: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: B = None
        self.o: C = None
        self.w: J = None
        self.v: I = None
        self.t: C = None
        self.y: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: D = None
        self.v: A = None
        self.x: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: A = None
        self.p: I = None
        self.txt = txt

b = A("b")
k = B("k")
i = C("i")
n = D("n")
d = E("d")
m = F("m")
e = G("e")
a = H("a")
l = I("l")
g = J("g")

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

class B:
    def __init__(self, txt: str):
        self.z: J = None
        self.t: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: B = None
        self.o: C = None
        self.w: J = None
        self.v: I = None
        self.t: C = None
        self.y: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: D = None
        self.v: A = None
        self.x: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: A = None
        self.p: I = None
        self.txt = txt

b = A("b")
k = B("k")
i = C("i")
n = D("n")
d = E("d")
m = F("m")
e = G("e")
a = H("a")
l = I("l")
g = J("g")

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