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

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

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

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

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

a = A("a")
k = B("k")
g = C("g")
l = D("l")
b = E("b")

a.v = b
a.s = b
a.u = k
a.w = k
k.p = g
k.x = a
k.y = l
g.o = l
g.t = b
g.q = b
g.z = a
l.x = g
l.u = g
l.o = g
l.w = b
l.q = b
b.v = k
b.q = a
b.z = l
assert l.w.q.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: E = None
        self.u: B = None
        self.w: B = None
        self.txt = txt

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

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

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

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

a = A("a")
k = B("k")
g = C("g")
l = D("l")
b = E("b")

a.v = b
a.s = b
a.u = k
a.w = k
k.p = g
k.x = a
k.y = l
g.o = l
g.t = b
g.q = b
g.z = a
l.x = g
l.u = g
l.o = g
l.w = b
l.q = b
b.v = k
b.q = a
b.z = l
assert l.w.q.w.y.txt == "l"