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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: D = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: B = None
        self.t: C = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: A = None
        self.o: A = None
        self.q: D = None
        self.p: C = None
        self.txt = txt

n = A("n")
e = B("e")
d = C("d")
h = D("h")
k = E("k")
f = A("f")
i = E("i")
a = C("a")

n.y = e
n.w = e
n.u = k
n.s = f
e.p = i
e.t = h
e.y = f
d.p = n
d.o = e
d.t = a
d.s = i
h.t = f
h.y = i
k.v = h
k.q = h
k.u = n
k.o = n
k.p = d
f.y = e
f.w = e
f.u = i
f.s = n
i.v = h
i.q = h
i.u = f
i.o = n
i.p = d
a.p = f
a.o = e
a.t = d
a.s = i
assert k.q.t.w.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: B = None
        self.u: E = None
        self.s: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: D = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: B = None
        self.t: C = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: A = None
        self.o: A = None
        self.q: D = None
        self.p: C = None
        self.txt = txt

n = A("n")
e = B("e")
d = C("d")
h = D("h")
k = E("k")
f = A("f")
i = E("i")
a = C("a")

n.y = e
n.w = e
n.u = k
n.s = f
e.p = i
e.t = h
e.y = f
d.p = n
d.o = e
d.t = a
d.s = i
h.t = f
h.y = i
k.v = h
k.q = h
k.u = n
k.o = n
k.p = d
f.y = e
f.w = e
f.u = i
f.s = n
i.v = h
i.q = h
i.u = f
i.o = n
i.p = d
a.p = f
a.o = e
a.t = d
a.s = i
assert k.q.t.w.p.o.txt == "n"