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

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.r: G = None
        self.v: H = None
        self.w: H = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: D = None
        self.p: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.r: G = None
        self.v: H = None
        self.w: H = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: D = None
        self.p: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

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