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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: A = None
        self.x: A = None
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: A = None
        self.txt = txt

i = A("i")
a = B("a")
e = C("e")
c = D("c")
l = E("l")

i.v = a
a.r = c
a.q = i
a.y = l
a.t = e
e.v = c
e.z = i
e.x = i
e.t = l
c.q = e
l.t = c
l.u = i
assert i.v.y.t.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: A = None
        self.x: A = None
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: A = None
        self.txt = txt

i = A("i")
a = B("a")
e = C("e")
c = D("c")
l = E("l")

i.v = a
a.r = c
a.q = i
a.y = l
a.t = e
e.v = c
e.z = i
e.x = i
e.t = l
c.q = e
l.t = c
l.u = i
assert i.v.y.t.q.t.txt == "l"