class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

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

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

i.r = e
l.t = i
l.v = e
l.o = n
l.w = j
e.y = n
e.z = l
j.o = e
j.q = e
j.r = a
n.y = a
n.r = i
a.y = n
a.r = i
assert a.r.r.z.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

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

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

i.r = e
l.t = i
l.v = e
l.o = n
l.w = j
e.y = n
e.z = l
j.o = e
j.q = e
j.r = a
n.y = a
n.r = i
a.y = n
a.r = i
assert a.r.r.z.t.r.txt == "e"