class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: B = None
        self.o: D = 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.z: A = None
        self.s: B = None
        self.y: B = None
        self.u: A = None
        self.txt = txt

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

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

d.s = n
d.w = a
d.o = k
i.v = k
n.z = l
n.u = l
n.s = c
n.y = i
k.y = d
a.v = k
b.v = k
c.v = k
l.s = n
l.w = b
l.o = k
j.z = l
j.u = l
j.s = c
j.y = a
assert j.y.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: B = None
        self.o: D = 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.z: A = None
        self.s: B = None
        self.y: B = None
        self.u: A = None
        self.txt = txt

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

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

d.s = n
d.w = a
d.o = k
i.v = k
n.z = l
n.u = l
n.s = c
n.y = i
k.y = d
a.v = k
b.v = k
c.v = k
l.s = n
l.w = b
l.o = k
j.z = l
j.u = l
j.s = c
j.y = a
assert j.y.v.y.txt == "d"