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

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

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

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

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

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

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

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

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

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

l.s = i
l.u = k
l.x = d
k.t = d
d.v = l
d.w = l
d.o = i
c.v = k
c.x = d
c.r = n
c.t = n
i.v = l
i.w = l
i.o = d
n.v = k
n.x = d
n.r = c
n.t = c
assert i.w.x.o.w.s.o.txt == "d"