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

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

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

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

c = A("c")
j = B("j")
n = C("n")
b = D("b")
l = D("l")
d = B("d")
f = D("f")
i = C("i")

c.o = l
j.z = b
j.v = i
n.s = b
n.v = d
n.z = c
n.w = c
b.t = c
b.y = c
b.r = f
l.t = c
l.y = c
l.r = b
d.z = f
d.v = n
f.t = c
f.y = c
f.r = l
i.s = f
i.v = d
i.z = c
i.w = c
assert c.o.r.y.o.r.r.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

c = A("c")
j = B("j")
n = C("n")
b = D("b")
l = D("l")
d = B("d")
f = D("f")
i = C("i")

c.o = l
j.z = b
j.v = i
n.s = b
n.v = d
n.z = c
n.w = c
b.t = c
b.y = c
b.r = f
l.t = c
l.y = c
l.r = b
d.z = f
d.v = n
f.t = c
f.y = c
f.r = l
i.s = f
i.v = d
i.z = c
i.w = c
assert c.o.r.y.o.r.r.t.o.txt == "l"