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

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

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

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

a = A("a")
i = B("i")
j = C("j")
b = D("b")
n = C("n")
e = B("e")
d = A("d")

a.y = n
a.w = n
a.v = j
i.y = d
i.u = n
i.w = e
j.v = n
j.s = b
b.y = j
b.p = j
b.w = i
n.v = j
n.s = b
e.y = d
e.u = j
e.w = i
d.y = n
d.v = n
d.w = j
assert j.v.s.w.w.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: C = None
        self.v: C = None
        self.txt = txt

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

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

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

a = A("a")
i = B("i")
j = C("j")
b = D("b")
n = C("n")
e = B("e")
d = A("d")

a.y = n
a.w = n
a.v = j
i.y = d
i.u = n
i.w = e
j.v = n
j.s = b
b.y = j
b.p = j
b.w = i
n.v = j
n.s = b
e.y = d
e.u = j
e.w = i
d.y = n
d.v = n
d.w = j
assert j.v.s.w.w.u.v.txt == "n"