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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

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

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

a.t = l
a.o = e
a.v = e
a.z = i
f.q = i
i.r = l
j.s = a
j.z = e
j.w = e
d.v = j
d.t = l
m.q = i
e.v = j
e.t = a
l.t = a
l.o = e
l.z = i
l.v = d
assert f.q.r.o.t.z.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: E = None
        self.z: C = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

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

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

a.t = l
a.o = e
a.v = e
a.z = i
f.q = i
i.r = l
j.s = a
j.z = e
j.w = e
d.v = j
d.t = l
m.q = i
e.v = j
e.t = a
l.t = a
l.o = e
l.z = i
l.v = d
assert f.q.r.o.t.z.r.t.txt == "a"