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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: A = None
        self.txt = txt

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

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

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