class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: B = None
        self.t: F = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: C = None
        self.q: F = None
        self.y: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: B = None
        self.p: A = None
        self.txt = txt

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

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

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

n.w = f
n.p = k
f.y = l
f.q = e
f.z = k
k.z = b
k.r = f
k.u = f
k.t = l
d.t = n
d.o = k
d.q = l
d.y = b
e.p = m
e.w = d
l.t = g
l.u = f
l.p = n
m.w = l
b.w = a
b.z = n
a.z = g
a.r = f
a.u = f
a.t = l
g.w = a
g.z = n
assert a.z.z.w.z.t.t.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: B = None
        self.t: F = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: C = None
        self.q: F = None
        self.y: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: B = None
        self.p: A = None
        self.txt = txt

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

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

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

n.w = f
n.p = k
f.y = l
f.q = e
f.z = k
k.z = b
k.r = f
k.u = f
k.t = l
d.t = n
d.o = k
d.q = l
d.y = b
e.p = m
e.w = d
l.t = g
l.u = f
l.p = n
m.w = l
b.w = a
b.z = n
a.z = g
a.r = f
a.u = f
a.t = l
g.w = a
g.z = n
assert a.z.z.w.z.t.t.z.p.txt == "k"