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

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

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

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

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

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

c.v = m
c.s = k
k.u = l
f.s = m
m.q = l
m.o = l
m.v = c
l.x = c
l.r = c
l.q = k
l.w = k
l.t = m
assert c.v.v.s.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

c.v = m
c.s = k
k.u = l
f.s = m
m.q = l
m.o = l
m.v = c
l.x = c
l.r = c
l.q = k
l.w = k
l.t = m
assert c.v.v.s.u.x.txt == "c"