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

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: C = None
        self.txt = txt

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

d = A("d")
a = B("a")
n = C("n")
l = D("l")
i = E("i")
h = D("h")

d.y = l
d.u = n
d.w = h
d.t = a
d.o = i
a.p = n
n.o = d
l.t = d
l.u = n
i.u = d
i.r = a
i.x = h
h.t = d
h.u = n
assert d.o.u.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: C = None
        self.w: D = None
        self.t: B = None
        self.o: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: C = None
        self.txt = txt

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

d = A("d")
a = B("a")
n = C("n")
l = D("l")
i = E("i")
h = D("h")

d.y = l
d.u = n
d.w = h
d.t = a
d.o = i
a.p = n
n.o = d
l.t = d
l.u = n
i.u = d
i.r = a
i.x = h
h.t = d
h.u = n
assert d.o.u.w.u.txt == "n"