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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: G = None
        self.v: I = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: D = None
        self.o: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: E = None
        self.p: D = None
        self.s: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: E = None
        self.x: H = None
        self.y: H = None
        self.p: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: G = None
        self.v: I = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: D = None
        self.o: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: E = None
        self.p: D = None
        self.s: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: E = None
        self.x: H = None
        self.y: H = None
        self.p: F = None
        self.txt = txt

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

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

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