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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: A = None
        self.o: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: A = None
        self.o: D = None
        self.txt = txt

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

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

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

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