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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: A = None
        self.p: B = None
        self.txt = txt

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

j = A("j")
m = B("m")
h = C("h")
e = D("e")
l = E("l")
k = A("k")
a = B("a")

j.s = e
j.t = k
m.z = l
m.q = e
m.o = h
h.z = j
e.w = m
e.u = k
e.p = a
l.p = m
l.z = a
l.o = a
k.s = e
k.t = j
a.z = l
a.q = e
a.o = h
assert e.w.o.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: A = None
        self.p: B = None
        self.txt = txt

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

j = A("j")
m = B("m")
h = C("h")
e = D("e")
l = E("l")
k = A("k")
a = B("a")

j.s = e
j.t = k
m.z = l
m.q = e
m.o = h
h.z = j
e.w = m
e.u = k
e.p = a
l.p = m
l.z = a
l.o = a
k.s = e
k.t = j
a.z = l
a.q = e
a.o = h
assert e.w.o.z.s.txt == "e"