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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

k.s = l
k.w = d
k.o = n
k.z = f
e.r = d
d.v = n
d.u = h
n.o = f
f.v = k
f.y = k
f.u = d
l.r = d
h.r = d
assert n.o.u.u.r.v.o.y.txt == "k"