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

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

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

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

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

j = A("j")
e = B("e")
c = C("c")
i = D("i")
f = E("f")

j.w = f
j.o = c
e.v = i
c.u = i
c.p = i
i.t = c
i.u = e
i.o = f
f.u = j
assert e.v.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: C = None
        self.txt = txt

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

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

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

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

j = A("j")
e = B("e")
c = C("c")
i = D("i")
f = E("f")

j.w = f
j.o = c
e.v = i
c.u = i
c.p = i
i.t = c
i.u = e
i.o = f
f.u = j
assert e.v.t.u.txt == "i"