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

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

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

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

n = A("n")
e = B("e")
a = C("a")
j = D("j")
d = A("d")
k = D("k")
l = D("l")
i = B("i")

n.y = a
n.w = a
n.z = i
n.s = e
e.o = i
e.y = i
e.r = i
e.t = i
a.w = l
j.x = d
d.y = a
d.w = a
d.z = e
d.s = i
k.x = d
l.x = n
i.o = e
i.y = e
i.r = e
i.t = e
assert d.w.w.x.z.o.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: B = None
        self.s: B = None
        self.w: C = None
        self.txt = txt

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

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

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

n = A("n")
e = B("e")
a = C("a")
j = D("j")
d = A("d")
k = D("k")
l = D("l")
i = B("i")

n.y = a
n.w = a
n.z = i
n.s = e
e.o = i
e.y = i
e.r = i
e.t = i
a.w = l
j.x = d
d.y = a
d.w = a
d.z = e
d.s = i
k.x = d
l.x = n
i.o = e
i.y = e
i.r = e
i.t = e
assert d.w.w.x.z.o.t.t.txt == "e"