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

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

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

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

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

c = A("c")
i = B("i")
g = C("g")
l = D("l")
f = E("f")

c.u = f
c.v = g
c.w = g
c.z = i
c.o = l
i.s = g
i.u = g
i.t = l
g.y = c
l.v = f
f.v = l
assert f.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: C = None
        self.z: B = None
        self.o: D = None
        self.w: C = None
        self.txt = txt

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

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

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

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

c = A("c")
i = B("i")
g = C("g")
l = D("l")
f = E("f")

c.u = f
c.v = g
c.w = g
c.z = i
c.o = l
i.s = g
i.u = g
i.t = l
g.y = c
l.v = f
f.v = l
assert f.v.v.v.v.txt == "f"