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

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

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

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

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

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

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

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

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

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

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