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

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

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

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

n = A("n")
k = B("k")
d = C("d")
b = D("b")
e = D("e")
i = C("i")
l = B("l")

n.q = l
n.s = i
n.w = i
k.w = l
d.x = i
d.u = e
d.s = e
d.t = l
b.v = d
e.v = i
i.x = d
i.u = b
i.s = b
i.t = l
l.w = k
assert l.w.w.w.w.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: C = None
        self.w: C = None
        self.txt = txt

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

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

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

n = A("n")
k = B("k")
d = C("d")
b = D("b")
e = D("e")
i = C("i")
l = B("l")

n.q = l
n.s = i
n.w = i
k.w = l
d.x = i
d.u = e
d.s = e
d.t = l
b.v = d
e.v = i
i.x = d
i.u = b
i.s = b
i.t = l
l.w = k
assert l.w.w.w.w.w.w.w.txt == "k"