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

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

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

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

a = A("a")
j = B("j")
k = C("k")
b = D("b")
f = A("f")
l = A("l")
i = B("i")
d = D("d")
n = C("n")
g = C("g")

a.s = k
a.o = i
a.w = i
a.t = f
j.v = d
j.s = d
j.w = b
k.r = g
k.w = b
b.t = l
b.u = d
b.p = i
f.s = k
f.o = j
f.w = i
f.t = a
l.s = k
l.o = j
l.w = i
l.t = a
i.v = b
i.w = b
i.s = b
d.t = f
d.u = b
d.p = j
n.r = k
n.w = d
g.r = k
g.w = d
assert f.s.w.p.w.p.w.p.v.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: B = None
        self.w: B = None
        self.t: A = None
        self.txt = txt

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

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

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

a = A("a")
j = B("j")
k = C("k")
b = D("b")
f = A("f")
l = A("l")
i = B("i")
d = D("d")
n = C("n")
g = C("g")

a.s = k
a.o = i
a.w = i
a.t = f
j.v = d
j.s = d
j.w = b
k.r = g
k.w = b
b.t = l
b.u = d
b.p = i
f.s = k
f.o = j
f.w = i
f.t = a
l.s = k
l.o = j
l.w = i
l.t = a
i.v = b
i.w = b
i.s = b
d.t = f
d.u = b
d.p = j
n.r = k
n.w = d
g.r = k
g.w = d
assert f.s.w.p.w.p.w.p.v.t.t.txt == "a"