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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: E = 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.o: D = None
        self.txt = txt

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

e.z = h
h.s = n
n.r = l
n.x = l
f.w = n
l.o = f
a.s = n
assert e.z.s.r.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: E = 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.o: D = None
        self.txt = txt

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

e.z = h
h.s = n
n.r = l
n.x = l
f.w = n
l.o = f
a.s = n
assert e.z.s.r.o.w.txt == "n"