class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

c = A("c")
m = B("m")
k = C("k")
l = D("l")
i = E("i")
d = D("d")
n = B("n")
f = C("f")

c.s = i
m.u = l
k.s = i
k.v = i
k.u = f
k.z = f
l.w = m
l.p = i
l.y = f
i.u = c
i.t = n
d.w = m
d.p = i
d.y = f
n.u = d
f.s = i
f.v = i
f.u = k
f.z = k
assert n.u.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

c = A("c")
m = B("m")
k = C("k")
l = D("l")
i = E("i")
d = D("d")
n = B("n")
f = C("f")

c.s = i
m.u = l
k.s = i
k.v = i
k.u = f
k.z = f
l.w = m
l.p = i
l.y = f
i.u = c
i.t = n
d.w = m
d.p = i
d.y = f
n.u = d
f.s = i
f.v = i
f.u = k
f.z = k
assert n.u.w.u.txt == "l"