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

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

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

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

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

a = A("a")
k = B("k")
i = C("i")
j = D("j")
l = E("l")
d = A("d")

a.u = i
a.p = i
a.w = l
k.t = i
k.v = a
i.q = k
i.u = j
i.p = l
j.t = i
j.v = i
j.s = l
j.q = l
l.w = i
l.s = d
d.u = i
d.p = i
d.w = l
assert a.w.w.u.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: E = None
        self.p: C = None
        self.txt = txt

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

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

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

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

a = A("a")
k = B("k")
i = C("i")
j = D("j")
l = E("l")
d = A("d")

a.u = i
a.p = i
a.w = l
k.t = i
k.v = a
i.q = k
i.u = j
i.p = l
j.t = i
j.v = i
j.s = l
j.q = l
l.w = i
l.s = d
d.u = i
d.p = i
d.w = l
assert a.w.w.u.q.s.txt == "d"