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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: B = None
        self.q: A = None
        self.t: A = None
        self.txt = txt

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

a.v = g
a.t = g
a.p = d
a.s = m
i.t = g
i.z = d
b.w = i
b.q = k
b.s = g
b.t = m
m.r = d
m.v = i
m.s = c
g.r = m
g.w = i
g.q = k
g.t = d
d.v = g
d.t = g
d.p = a
d.s = m
c.w = i
c.q = d
c.s = g
c.t = m
k.v = g
k.t = g
k.p = d
k.s = m
assert c.q.p.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: A = None
        self.t: E = None
        self.s: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: B = None
        self.q: A = None
        self.t: A = None
        self.txt = txt

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

a.v = g
a.t = g
a.p = d
a.s = m
i.t = g
i.z = d
b.w = i
b.q = k
b.s = g
b.t = m
m.r = d
m.v = i
m.s = c
g.r = m
g.w = i
g.q = k
g.t = d
d.v = g
d.t = g
d.p = a
d.s = m
c.w = i
c.q = d
c.s = g
c.t = m
k.v = g
k.t = g
k.p = d
k.s = m
assert c.q.p.s.s.txt == "c"