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

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

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

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

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

a = A("a")
b = B("b")
e = C("e")
f = D("f")
l = E("l")
j = B("j")
m = D("m")

a.v = m
a.o = m
a.w = b
b.x = f
b.s = f
b.r = m
b.z = a
e.v = l
f.v = b
l.z = b
l.r = a
l.x = e
l.o = f
j.x = f
j.r = m
j.s = m
j.z = a
m.v = j
assert f.v.r.v.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: D = None
        self.w: B = None
        self.txt = txt

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

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

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

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

a = A("a")
b = B("b")
e = C("e")
f = D("f")
l = E("l")
j = B("j")
m = D("m")

a.v = m
a.o = m
a.w = b
b.x = f
b.s = f
b.r = m
b.z = a
e.v = l
f.v = b
l.z = b
l.r = a
l.x = e
l.o = f
j.x = f
j.r = m
j.s = m
j.z = a
m.v = j
assert f.v.r.v.s.v.txt == "j"