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

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

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

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

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

j = A("j")
b = B("b")
e = C("e")
i = D("i")
l = E("l")

j.v = l
b.s = e
b.y = j
b.u = i
e.w = l
e.v = j
e.x = b
i.o = e
i.s = e
i.z = b
l.w = b
l.s = b
l.u = e
assert b.s.v.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

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

j = A("j")
b = B("b")
e = C("e")
i = D("i")
l = E("l")

j.v = l
b.s = e
b.y = j
b.u = i
e.w = l
e.v = j
e.x = b
i.o = e
i.s = e
i.z = b
l.w = b
l.s = b
l.u = e
assert b.s.v.v.w.txt == "b"