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

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

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

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

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

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

d.s = k
d.u = c
d.x = l
k.x = n
k.t = d
k.r = d
k.w = c
k.z = a
a.y = i
n.q = k
m.v = i
l.v = i
c.y = i
i.s = k
i.u = c
i.x = l
assert i.x.v.s.z.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: C = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

d.s = k
d.u = c
d.x = l
k.x = n
k.t = d
k.r = d
k.w = c
k.z = a
a.y = i
n.q = k
m.v = i
l.v = i
c.y = i
i.s = k
i.u = c
i.x = l
assert i.x.v.s.z.y.s.txt == "k"