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

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

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

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

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

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

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

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

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

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

n.q = e
n.v = d
n.y = b
f.p = i
f.r = e
k.w = d
i.u = h
i.r = h
d.w = k
e.p = i
e.r = f
j.q = f
j.v = d
j.y = b
h.p = i
h.r = e
b.q = f
b.v = k
b.y = n
assert n.y.v.w.w.w.w.w.w.txt == "k"