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

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.v: B = None
        self.txt = txt

l = A("l")
e = B("e")
d = C("d")
n = D("n")
b = A("b")
h = A("h")

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.v: B = None
        self.txt = txt

l = A("l")
e = B("e")
d = C("d")
n = D("n")
b = A("b")
h = A("h")

l.w = d
l.o = d
l.z = n
l.y = e
e.r = d
e.y = b
d.r = e
d.s = e
d.o = n
d.x = h
n.w = d
n.t = d
n.v = e
b.w = d
b.o = d
b.z = n
b.y = e
h.w = d
h.o = d
h.z = n
h.y = e
assert n.v.r.o.t.x.txt == "h"