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

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

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

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

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

f.w = b
k.y = n
a.q = l
a.r = l
a.z = c
l.t = n
l.p = n
l.s = f
l.v = i
e.t = n
e.p = n
e.s = f
e.v = b
m.w = b
i.y = e
b.y = n
c.t = l
c.p = l
c.s = f
c.v = k
n.t = l
n.s = m
n.p = e
n.v = k
assert a.q.s.w.y.s.w.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

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

f.w = b
k.y = n
a.q = l
a.r = l
a.z = c
l.t = n
l.p = n
l.s = f
l.v = i
e.t = n
e.p = n
e.s = f
e.v = b
m.w = b
i.y = e
b.y = n
c.t = l
c.p = l
c.s = f
c.v = k
n.t = l
n.s = m
n.p = e
n.v = k
assert a.q.s.w.y.s.w.y.v.txt == "k"