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

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

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

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

i = A("i")
l = B("l")
f = C("f")
e = D("e")

i.y = e
i.p = e
i.u = l
i.o = l
l.r = i
l.z = i
f.s = e
f.x = i
f.v = i
f.y = i
e.x = l
assert l.z.y.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: D = None
        self.u: B = None
        self.o: B = None
        self.txt = txt

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

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

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

i = A("i")
l = B("l")
f = C("f")
e = D("e")

i.y = e
i.p = e
i.u = l
i.o = l
l.r = i
l.z = i
f.s = e
f.x = i
f.v = i
f.y = i
e.x = l
assert l.z.y.x.z.txt == "i"