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

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

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

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

l = A("l")
a = B("a")
d = C("d")
k = D("k")
j = B("j")
i = D("i")
f = A("f")
g = C("g")
n = C("n")

l.x = i
l.u = i
l.v = d
l.t = a
a.x = i
a.w = l
d.z = i
k.y = i
k.s = i
k.w = i
k.z = i
j.x = i
j.w = f
i.y = k
i.s = k
i.w = k
i.z = k
f.x = k
f.v = g
f.u = i
f.t = j
g.z = k
n.z = i
assert i.s.y.w.z.y.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: C = None
        self.u: D = None
        self.t: B = None
        self.txt = txt

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

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

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

l = A("l")
a = B("a")
d = C("d")
k = D("k")
j = B("j")
i = D("i")
f = A("f")
g = C("g")
n = C("n")

l.x = i
l.u = i
l.v = d
l.t = a
a.x = i
a.w = l
d.z = i
k.y = i
k.s = i
k.w = i
k.z = i
j.x = i
j.w = f
i.y = k
i.s = k
i.w = k
i.z = k
f.x = k
f.v = g
f.u = i
f.t = j
g.z = k
n.z = i
assert i.s.y.w.z.y.s.w.txt == "k"