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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: E = None
        self.z: C = None
        self.r: C = None
        self.txt = txt

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

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

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

l = A("l")
e = B("e")
m = C("m")
b = D("b")
g = E("g")

l.v = g
l.x = g
l.r = g
l.y = e
l.q = e
e.v = l
e.q = g
e.z = m
e.r = m
m.u = g
b.u = e
g.z = l
g.x = l
assert e.z.u.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: E = None
        self.y: B = None
        self.q: B = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: E = None
        self.z: C = None
        self.r: C = None
        self.txt = txt

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

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

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

l = A("l")
e = B("e")
m = C("m")
b = D("b")
g = E("g")

l.v = g
l.x = g
l.r = g
l.y = e
l.q = e
e.v = l
e.q = g
e.z = m
e.r = m
m.u = g
b.u = e
g.z = l
g.x = l
assert e.z.u.x.y.txt == "e"