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

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

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

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

n = A("n")
i = B("i")
c = C("c")
m = D("m")
k = A("k")
a = B("a")
e = D("e")
g = A("g")
b = D("b")
f = C("f")

n.t = a
n.o = m
i.w = m
i.t = a
i.v = f
c.v = f
c.r = a
m.s = e
k.t = i
k.o = e
a.w = b
a.t = i
a.v = c
e.s = m
g.t = i
g.o = e
b.s = e
f.v = c
f.r = i
assert i.v.v.r.w.s.s.s.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: D = None
        self.txt = txt

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

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

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

n = A("n")
i = B("i")
c = C("c")
m = D("m")
k = A("k")
a = B("a")
e = D("e")
g = A("g")
b = D("b")
f = C("f")

n.t = a
n.o = m
i.w = m
i.t = a
i.v = f
c.v = f
c.r = a
m.s = e
k.t = i
k.o = e
a.w = b
a.t = i
a.v = c
e.s = m
g.t = i
g.o = e
b.s = e
f.v = c
f.r = i
assert i.v.v.r.w.s.s.s.s.s.s.txt == "m"