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

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

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

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

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

n = A("n")
j = B("j")
a = C("a")
g = D("g")
m = E("m")
d = A("d")

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

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

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

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

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

n = A("n")
j = B("j")
a = C("a")
g = D("g")
m = E("m")
d = A("d")

n.s = d
n.y = a
j.q = g
j.t = m
j.r = n
a.v = j
a.t = j
a.o = g
g.v = m
g.q = a
m.y = a
m.z = g
m.t = g
m.w = n
m.o = j
d.s = n
d.y = a
assert m.w.y.o.v.y.t.txt == "j"