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

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

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

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

n = A("n")
k = B("k")
i = C("i")
e = D("e")
c = D("c")
d = A("d")
b = B("b")
a = C("a")
f = D("f")

n.t = a
k.q = d
k.v = i
k.w = b
i.p = k
i.y = d
e.w = b
c.w = k
d.t = a
b.q = n
b.v = i
b.w = k
a.p = b
a.y = n
f.w = b
assert f.w.v.y.t.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

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

n = A("n")
k = B("k")
i = C("i")
e = D("e")
c = D("c")
d = A("d")
b = B("b")
a = C("a")
f = D("f")

n.t = a
k.q = d
k.v = i
k.w = b
i.p = k
i.y = d
e.w = b
c.w = k
d.t = a
b.q = n
b.v = i
b.w = k
a.p = b
a.y = n
f.w = b
assert f.w.v.y.t.p.q.txt == "n"