class A:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: J = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: G = None
        self.r: F = None
        self.y: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: A = None
        self.t: E = None
        self.o: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: J = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: G = None
        self.r: F = None
        self.y: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: A = None
        self.t: E = None
        self.o: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.w: E = None
        self.txt = txt

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

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

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