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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: I = None
        self.w: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: F = None
        self.o: F = None
        self.z: F = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: E = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: I = None
        self.t: B = None
        self.q: H = None
        self.z: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: F = None
        self.p: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: J = None
        self.w: J = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: I = None
        self.w: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: F = None
        self.o: F = None
        self.z: F = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: E = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: I = None
        self.t: B = None
        self.q: H = None
        self.z: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: F = None
        self.p: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: J = None
        self.w: J = None
        self.txt = txt

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

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

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