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

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

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

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

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

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

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

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

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

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

f.v = l
f.q = n
f.o = n
i.y = c
l.t = i
l.y = i
c.z = n
c.s = n
c.w = f
c.t = l
n.z = c
n.s = c
n.w = f
n.t = l
assert l.t.y.w.v.txt == "l"