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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: D = None
        self.x: C = None
        self.y: E = None
        self.q: A = None
        self.t: H = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: F = None
        self.x: G = None
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: H = None
        self.r: B = None
        self.v: B = None
        self.o: A = None
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: D = None
        self.x: C = None
        self.y: E = None
        self.q: A = None
        self.t: H = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: F = None
        self.x: G = None
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: H = None
        self.r: B = None
        self.v: B = None
        self.o: A = None
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: G = None
        self.txt = txt

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

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

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

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