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

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

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

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

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

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

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

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

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

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

k.x = g
k.v = d
k.s = n
i.o = a
i.s = a
i.q = n
a.o = d
a.q = g
a.z = g
a.w = n
b.o = n
b.q = k
b.v = i
n.o = b
n.q = k
n.v = i
d.o = a
d.s = g
d.q = n
l.o = g
l.s = a
l.q = n
h.x = g
h.v = i
h.s = n
g.o = i
g.q = a
g.z = a
g.w = b
assert d.o.z.w.q.s.o.txt == "b"