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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: A = None
        self.u: D = None
        self.s: F = None
        self.z: F = None
        self.w: E = None
        self.q: E = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: A = None
        self.q: G = None
        self.t: F = None
        self.s: E = None
        self.z: A = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: A = None
        self.o: C = None
        self.p: G = None
        self.y: G = None
        self.t: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: H = None
        self.z: H = None
        self.w: C = None
        self.p: H = None
        self.y: H = None
        self.r: A = None
        self.q: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: E = None
        self.y: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: A = None
        self.u: D = None
        self.s: F = None
        self.z: F = None
        self.w: E = None
        self.q: E = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: A = None
        self.q: G = None
        self.t: F = None
        self.s: E = None
        self.z: A = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: A = None
        self.o: C = None
        self.p: G = None
        self.y: G = None
        self.t: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: H = None
        self.z: H = None
        self.w: C = None
        self.p: H = None
        self.y: H = None
        self.r: A = None
        self.q: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: E = None
        self.y: F = None
        self.txt = txt

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

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