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

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

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

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

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

m = A("m")
l = B("l")
a = C("a")
c = D("c")
g = E("g")
i = C("i")
f = D("f")
j = B("j")
k = B("k")

m.v = l
m.s = g
l.v = m
l.p = g
a.s = c
a.p = f
a.t = g
a.v = m
c.w = a
g.y = m
g.q = m
i.s = f
i.p = f
i.t = g
i.v = m
f.w = a
j.v = m
j.p = g
k.v = m
k.p = g
assert g.y.v.v.s.y.s.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: E = None
        self.txt = txt

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

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

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

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

m = A("m")
l = B("l")
a = C("a")
c = D("c")
g = E("g")
i = C("i")
f = D("f")
j = B("j")
k = B("k")

m.v = l
m.s = g
l.v = m
l.p = g
a.s = c
a.p = f
a.t = g
a.v = m
c.w = a
g.y = m
g.q = m
i.s = f
i.p = f
i.t = g
i.v = m
f.w = a
j.v = m
j.p = g
k.v = m
k.p = g
assert g.y.v.v.s.y.s.q.v.txt == "l"