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

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

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

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

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

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

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

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

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

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

l.v = b
l.w = i
l.u = n
b.t = e
b.x = i
b.p = l
b.w = a
i.s = e
a.v = b
a.t = e
n.v = b
n.w = i
n.u = l
e.v = b
e.t = a
assert n.w.s.t.t.t.t.txt == "e"