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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: C = None
        self.p: C = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: E = None
        self.v: A = None
        self.p: E = None
        self.o: D = None
        self.txt = txt

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

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

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

a.q = e
a.v = l
a.x = l
a.y = i
l.r = e
l.w = j
l.p = j
l.s = a
j.y = i
j.z = i
j.p = i
j.v = a
j.o = e
e.s = i
i.o = j
i.q = l
assert l.w.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: B = None
        self.x: B = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: C = None
        self.p: C = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: E = None
        self.v: A = None
        self.p: E = None
        self.o: D = None
        self.txt = txt

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

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

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

a.q = e
a.v = l
a.x = l
a.y = i
l.r = e
l.w = j
l.p = j
l.s = a
j.y = i
j.z = i
j.p = i
j.v = a
j.o = e
e.s = i
i.o = j
i.q = l
assert l.w.v.y.txt == "i"