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

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

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

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

k = A("k")
c = B("c")
m = C("m")
n = D("n")
f = C("f")
h = A("h")
i = B("i")
e = C("e")

k.w = h
k.u = e
k.s = n
c.u = i
c.w = e
c.s = k
c.y = h
m.r = n
n.o = k
n.t = c
f.r = n
h.w = k
h.u = m
h.s = n
i.u = c
i.w = f
i.s = h
i.y = k
e.r = n
assert c.y.s.t.y.w.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: C = None
        self.s: D = None
        self.txt = txt

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

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

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

k = A("k")
c = B("c")
m = C("m")
n = D("n")
f = C("f")
h = A("h")
i = B("i")
e = C("e")

k.w = h
k.u = e
k.s = n
c.u = i
c.w = e
c.s = k
c.y = h
m.r = n
n.o = k
n.t = c
f.r = n
h.w = k
h.u = m
h.s = n
i.u = c
i.w = f
i.s = h
i.y = k
e.r = n
assert c.y.s.t.y.w.u.r.txt == "n"