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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: C = None
        self.u: B = None
        self.v: B = None
        self.txt = txt

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

l.r = f
l.o = c
l.u = c
l.t = g
c.p = g
c.w = g
c.x = g
c.q = f
c.v = l
e.s = c
e.x = f
e.p = f
f.q = g
g.r = c
g.u = c
g.v = c
g.x = e
assert e.s.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: B = None
        self.u: B = None
        self.t: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: C = None
        self.u: B = None
        self.v: B = None
        self.txt = txt

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

l.r = f
l.o = c
l.u = c
l.t = g
c.p = g
c.w = g
c.x = g
c.q = f
c.v = l
e.s = c
e.x = f
e.p = f
f.q = g
g.r = c
g.u = c
g.v = c
g.x = e
assert e.s.x.x.txt == "e"