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

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

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

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

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

c = A("c")
m = B("m")
d = C("d")
g = D("g")
k = E("k")
b = C("b")
e = D("e")

c.v = m
m.w = k
m.v = k
m.z = e
m.x = c
m.p = d
d.r = c
d.s = c
d.u = c
d.z = k
d.x = m
g.u = k
g.o = k
g.s = d
g.z = b
k.v = m
b.r = c
b.s = c
b.u = c
b.z = k
b.x = m
e.u = k
e.o = k
e.s = b
e.z = d
assert g.z.z.v.x.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

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

c = A("c")
m = B("m")
d = C("d")
g = D("g")
k = E("k")
b = C("b")
e = D("e")

c.v = m
m.w = k
m.v = k
m.z = e
m.x = c
m.p = d
d.r = c
d.s = c
d.u = c
d.z = k
d.x = m
g.u = k
g.o = k
g.s = d
g.z = b
k.v = m
b.r = c
b.s = c
b.u = c
b.z = k
b.x = m
e.u = k
e.o = k
e.s = b
e.z = d
assert g.z.z.v.x.v.w.txt == "k"