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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: D = None
        self.z: D = None
        self.w: B = None
        self.txt = txt

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

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

d = A("d")
b = B("b")
j = C("j")
h = D("h")
i = D("i")
k = D("k")
a = A("a")
n = D("n")
m = B("m")

d.y = b
b.p = n
b.u = n
b.z = h
b.w = m
j.y = a
h.v = j
h.o = j
h.s = k
i.v = j
i.o = j
i.s = k
k.v = j
k.o = j
k.s = n
a.y = m
n.v = j
n.o = j
n.s = k
m.p = i
m.u = k
m.z = n
m.w = b
assert n.v.y.y.w.p.o.y.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: D = None
        self.z: D = None
        self.w: B = None
        self.txt = txt

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

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

d = A("d")
b = B("b")
j = C("j")
h = D("h")
i = D("i")
k = D("k")
a = A("a")
n = D("n")
m = B("m")

d.y = b
b.p = n
b.u = n
b.z = h
b.w = m
j.y = a
h.v = j
h.o = j
h.s = k
i.v = j
i.o = j
i.s = k
k.v = j
k.o = j
k.s = n
a.y = m
n.v = j
n.o = j
n.s = k
m.p = i
m.u = k
m.z = n
m.w = b
assert n.v.y.y.w.p.o.y.y.z.txt == "n"