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

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

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

e = A("e")
i = B("i")
h = C("h")
l = B("l")
n = C("n")

e.p = i
e.v = l
i.r = l
i.w = l
h.z = l
h.y = i
h.w = e
l.r = i
l.w = i
n.z = l
n.y = l
n.w = e
assert e.p.r.r.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: B = None
        self.txt = txt

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

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

e = A("e")
i = B("i")
h = C("h")
l = B("l")
n = C("n")

e.p = i
e.v = l
i.r = l
i.w = l
h.z = l
h.y = i
h.w = e
l.r = i
l.w = i
n.z = l
n.y = l
n.w = e
assert e.p.r.r.w.w.txt == "i"