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

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

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: D = None
        self.t: B = None
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

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

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

n.y = m
d.v = f
d.w = n
m.s = e
m.q = b
m.t = d
m.v = l
m.o = f
b.v = m
b.q = m
b.z = l
b.w = n
l.q = f
l.w = g
l.z = m
g.v = m
g.q = m
g.z = l
g.w = n
e.s = m
e.q = g
e.t = d
e.v = l
e.o = f
f.q = l
f.w = g
f.z = e
assert l.z.t.v.z.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: D = None
        self.t: B = None
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

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

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

n.y = m
d.v = f
d.w = n
m.s = e
m.q = b
m.t = d
m.v = l
m.o = f
b.v = m
b.q = m
b.z = l
b.w = n
l.q = f
l.w = g
l.z = m
g.v = m
g.q = m
g.z = l
g.w = n
e.s = m
e.q = g
e.t = d
e.v = l
e.o = f
f.q = l
f.w = g
f.z = e
assert l.z.t.v.z.s.q.txt == "b"