class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: A = None
        self.x: J = None
        self.s: B = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: A = None
        self.x: G = None
        self.r: A = None
        self.z: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: A = None
        self.t: H = None
        self.x: I = None
        self.w: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: A = None
        self.x: J = None
        self.s: B = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: A = None
        self.x: G = None
        self.r: A = None
        self.z: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: A = None
        self.t: H = None
        self.x: I = None
        self.w: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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