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

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

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

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

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

f.s = j
l.z = e
j.v = f
j.o = e
b.s = f
b.w = f
b.o = i
b.x = l
c.s = f
c.w = f
c.o = i
c.x = e
i.s = f
i.w = f
i.o = c
i.x = e
e.z = l
n.v = f
n.o = e
assert n.v.s.o.z.z.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

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

f.s = j
l.z = e
j.v = f
j.o = e
b.s = f
b.w = f
b.o = i
b.x = l
c.s = f
c.w = f
c.o = i
c.x = e
i.s = f
i.w = f
i.o = c
i.x = e
e.z = l
n.v = f
n.o = e
assert n.v.s.o.z.z.z.z.z.txt == "l"