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

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

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: E = None
        self.y: C = None
        self.z: E = None
        self.w: E = None
        self.txt = txt

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

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

e = A("e")
i = B("i")
l = C("l")
f = D("f")
a = E("a")
m = A("m")
c = C("c")
d = D("d")

e.v = m
e.w = m
e.s = f
i.w = a
i.s = c
l.q = c
l.y = c
l.s = a
l.z = a
l.w = a
f.v = l
a.z = m
a.q = c
m.v = e
m.w = e
m.s = f
c.q = l
c.y = l
c.s = a
c.z = a
c.w = a
d.v = l
assert m.w.s.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: A = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: E = None
        self.y: C = None
        self.z: E = None
        self.w: E = None
        self.txt = txt

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

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

e = A("e")
i = B("i")
l = C("l")
f = D("f")
a = E("a")
m = A("m")
c = C("c")
d = D("d")

e.v = m
e.w = m
e.s = f
i.w = a
i.s = c
l.q = c
l.y = c
l.s = a
l.z = a
l.w = a
f.v = l
a.z = m
a.q = c
m.v = e
m.w = e
m.s = f
c.q = l
c.y = l
c.s = a
c.z = a
c.w = a
d.v = l
assert m.w.s.v.y.txt == "c"