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

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

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

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

n = A("n")
f = B("f")
l = C("l")
h = D("h")
j = B("j")
k = A("k")
i = A("i")
a = A("a")
e = B("e")
b = B("b")

n.y = f
n.p = h
n.w = k
n.t = i
f.u = a
l.p = k
h.s = k
j.u = n
k.y = f
k.p = h
k.w = n
k.t = a
i.y = b
i.p = h
i.w = k
i.t = a
a.y = b
a.p = h
a.w = k
a.t = k
e.u = i
b.u = i
assert e.u.w.w.y.u.p.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: D = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

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

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

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

n = A("n")
f = B("f")
l = C("l")
h = D("h")
j = B("j")
k = A("k")
i = A("i")
a = A("a")
e = B("e")
b = B("b")

n.y = f
n.p = h
n.w = k
n.t = i
f.u = a
l.p = k
h.s = k
j.u = n
k.y = f
k.p = h
k.w = n
k.t = a
i.y = b
i.p = h
i.w = k
i.t = a
a.y = b
a.p = h
a.w = k
a.t = k
e.u = i
b.u = i
assert e.u.w.w.y.u.p.s.w.txt == "n"