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

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

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

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

k = A("k")
e = B("e")
c = C("c")
l = D("l")
b = A("b")
f = D("f")
i = A("i")
a = C("a")
j = A("j")

k.s = f
k.o = a
k.t = j
e.s = f
c.t = j
c.s = l
c.x = l
c.v = e
l.w = f
b.s = l
b.o = a
b.t = j
f.w = l
i.s = l
i.o = a
i.t = k
a.t = b
a.s = f
a.v = e
a.x = l
j.s = f
j.o = c
j.t = b
assert a.t.o.v.s.w.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: C = None
        self.t: A = None
        self.txt = txt

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

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

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

k = A("k")
e = B("e")
c = C("c")
l = D("l")
b = A("b")
f = D("f")
i = A("i")
a = C("a")
j = A("j")

k.s = f
k.o = a
k.t = j
e.s = f
c.t = j
c.s = l
c.x = l
c.v = e
l.w = f
b.s = l
b.o = a
b.t = j
f.w = l
i.s = l
i.o = a
i.t = k
a.t = b
a.s = f
a.v = e
a.x = l
j.s = f
j.o = c
j.t = b
assert a.t.o.v.s.w.w.w.w.txt == "f"