class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: B = None
        self.r: E = None
        self.u: B = None
        self.v: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

j = A("j")
h = B("h")
e = C("e")
n = D("n")
l = E("l")

j.z = n
j.t = h
j.u = h
j.r = l
j.v = e
h.s = e
h.o = n
h.x = n
e.o = h
n.p = l
n.x = j
n.r = j
n.t = e
l.w = h
assert l.w.s.o.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: B = None
        self.r: E = None
        self.u: B = None
        self.v: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

j = A("j")
h = B("h")
e = C("e")
n = D("n")
l = E("l")

j.z = n
j.t = h
j.u = h
j.r = l
j.v = e
h.s = e
h.o = n
h.x = n
e.o = h
n.p = l
n.x = j
n.r = j
n.t = e
l.w = h
assert l.w.s.o.s.o.txt == "h"