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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: E = None
        self.p: F = None
        self.u: H = None
        self.z: A = None
        self.v: C = None
        self.r: A = None
        self.q: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: G = None
        self.u: C = None
        self.s: H = None
        self.y: D = None
        self.p: D = None
        self.o: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: B = None
        self.o: G = None
        self.r: C = None
        self.s: F = None
        self.t: C = None
        self.txt = txt

d = A("d")
i = B("i")
h = C("h")
n = D("n")
g = E("g")
b = F("b")
m = G("m")
k = H("k")

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: E = None
        self.p: F = None
        self.u: H = None
        self.z: A = None
        self.v: C = None
        self.r: A = None
        self.q: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: G = None
        self.u: C = None
        self.s: H = None
        self.y: D = None
        self.p: D = None
        self.o: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: B = None
        self.o: G = None
        self.r: C = None
        self.s: F = None
        self.t: C = None
        self.txt = txt

d = A("d")
i = B("i")
h = C("h")
n = D("n")
g = E("g")
b = F("b")
m = G("m")
k = H("k")

d.z = m
d.p = k
d.w = b
i.t = h
i.v = h
i.x = g
i.p = b
i.u = k
i.z = d
i.r = d
i.q = m
h.q = b
h.u = i
n.y = h
n.v = g
n.z = d
n.w = d
n.t = m
g.s = n
g.y = n
g.w = d
g.q = k
g.o = i
g.v = h
b.r = k
b.s = k
b.x = m
b.u = h
b.y = n
b.p = n
b.o = i
m.r = d
m.v = d
m.t = b
m.p = b
k.x = h
k.r = h
k.t = h
k.w = i
k.o = m
k.s = b
assert d.z.v.w.u.q.p.txt == "n"