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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: A = None
        self.s: A = None
        self.z: E = None
        self.p: E = None
        self.q: G = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: B = None
        self.q: F = None
        self.r: G = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: B = None
        self.t: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: G = None
        self.s: G = None
        self.t: E = None
        self.q: B = None
        self.u: G = None
        self.w: D = None
        self.txt = txt

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

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

b = A("b")
k = B("k")
n = C("n")
l = D("l")
c = E("c")
a = F("a")
d = G("d")
m = H("m")

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: A = None
        self.s: A = None
        self.z: E = None
        self.p: E = None
        self.q: G = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: B = None
        self.q: F = None
        self.r: G = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: B = None
        self.t: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: G = None
        self.s: G = None
        self.t: E = None
        self.q: B = None
        self.u: G = None
        self.w: D = None
        self.txt = txt

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

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

b = A("b")
k = B("k")
n = C("n")
l = D("l")
c = E("c")
a = F("a")
d = G("d")
m = H("m")

b.z = m
b.p = k
b.x = k
k.w = l
k.v = b
k.s = b
k.z = c
k.p = c
k.q = d
k.x = a
n.u = m
n.w = k
n.q = a
n.r = d
n.s = b
l.r = n
l.w = k
l.t = a
c.z = k
c.r = n
c.u = d
a.y = d
a.o = d
a.s = d
a.u = d
a.t = c
a.q = k
a.w = l
d.q = c
m.y = b
m.z = l
m.q = l
m.p = a
m.x = d
m.s = d
m.u = n
assert d.q.u.q.z.x.txt == "a"