class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: D = None
        self.t: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: E = None
        self.z: D = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: A = None
        self.r: B = None
        self.v: C = None
        self.txt = txt

n = A("n")
l = B("l")
f = C("f")
h = D("h")
a = E("a")
d = D("d")
k = B("k")
b = C("b")

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: E = None
        self.z: D = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: A = None
        self.r: B = None
        self.v: C = None
        self.txt = txt

n = A("n")
l = B("l")
f = C("f")
h = D("h")
a = E("a")
d = D("d")
k = B("k")
b = C("b")

n.w = l
n.z = d
n.t = k
l.q = a
l.s = a
l.u = a
l.v = f
f.o = n
h.v = f
h.u = a
h.z = d
h.s = n
a.z = n
a.y = n
a.r = l
a.v = b
d.v = b
d.u = a
d.z = h
d.s = n
k.q = a
k.s = a
k.u = a
k.v = f
b.o = n
assert d.s.z.z.s.w.txt == "l"