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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: F = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: J = None
        self.v: D = None
        self.x: H = None
        self.y: F = None
        self.z: J = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.z: H = None
        self.v: J = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: F = None
        self.x: A = None
        self.q: A = None
        self.z: I = None
        self.u: G = None
        self.v: I = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: H = None
        self.r: B = None
        self.o: C = None
        self.p: J = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: D = None
        self.r: E = None
        self.w: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: F = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: J = None
        self.v: D = None
        self.x: H = None
        self.y: F = None
        self.z: J = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.z: H = None
        self.v: J = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: F = None
        self.x: A = None
        self.q: A = None
        self.z: I = None
        self.u: G = None
        self.v: I = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: H = None
        self.r: B = None
        self.o: C = None
        self.p: J = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: D = None
        self.r: E = None
        self.w: D = None
        self.txt = txt

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

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