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

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

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

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

k = A("k")
g = B("g")
a = C("a")
m = D("m")
n = B("n")
d = C("d")
l = C("l")
b = A("b")

k.v = m
k.u = m
k.q = a
k.s = n
g.v = m
a.o = l
a.w = l
a.q = l
a.s = m
m.t = a
m.s = g
n.v = m
d.o = l
d.w = l
d.q = a
d.s = m
l.o = a
l.w = d
l.q = d
l.s = m
b.v = m
b.u = m
b.q = l
b.s = n
assert g.v.t.s.t.w.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: D = None
        self.q: C = None
        self.s: B = None
        self.txt = txt

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

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

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

k = A("k")
g = B("g")
a = C("a")
m = D("m")
n = B("n")
d = C("d")
l = C("l")
b = A("b")

k.v = m
k.u = m
k.q = a
k.s = n
g.v = m
a.o = l
a.w = l
a.q = l
a.s = m
m.t = a
m.s = g
n.v = m
d.o = l
d.w = l
d.q = a
d.s = m
l.o = a
l.w = d
l.q = d
l.s = m
b.v = m
b.u = m
b.q = l
b.s = n
assert g.v.t.s.t.w.s.t.txt == "a"