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

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

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

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

j = A("j")
h = B("h")
b = C("b")
k = D("k")
n = D("n")
l = D("l")
f = D("f")
g = C("g")
m = A("m")

j.w = b
h.r = j
b.y = k
b.w = k
b.t = n
k.v = b
k.y = g
n.v = b
n.y = b
l.v = g
l.y = b
f.v = g
f.y = b
g.y = l
g.w = l
g.t = f
m.w = b
assert h.r.w.y.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

j = A("j")
h = B("h")
b = C("b")
k = D("k")
n = D("n")
l = D("l")
f = D("f")
g = C("g")
m = A("m")

j.w = b
h.r = j
b.y = k
b.w = k
b.t = n
k.v = b
k.y = g
n.v = b
n.y = b
l.v = g
l.y = b
f.v = g
f.y = b
g.y = l
g.w = l
g.t = f
m.w = b
assert h.r.w.y.v.t.txt == "n"