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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

b = A("b")
a = B("a")
l = C("l")
c = D("c")
k = E("k")

b.v = c
b.o = c
b.s = a
a.t = l
a.v = b
a.o = b
a.z = b
a.q = k
l.s = b
l.y = b
l.x = a
c.v = k
c.r = l
k.r = c
assert l.s.o.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: D = None
        self.s: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

b = A("b")
a = B("a")
l = C("l")
c = D("c")
k = E("k")

b.v = c
b.o = c
b.s = a
a.t = l
a.v = b
a.o = b
a.z = b
a.q = k
l.s = b
l.y = b
l.x = a
c.v = k
c.r = l
k.r = c
assert l.s.o.r.x.txt == "a"