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

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

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

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

c = A("c")
k = B("k")
e = C("e")
n = D("n")

c.y = n
c.v = k
c.u = k
c.o = e
k.y = c
k.x = c
k.t = n
e.r = k
n.z = e
n.w = e
n.r = e
assert e.r.x.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: B = None
        self.o: C = None
        self.u: B = None
        self.txt = txt

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

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

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

c = A("c")
k = B("k")
e = C("e")
n = D("n")

c.y = n
c.v = k
c.u = k
c.o = e
k.y = c
k.x = c
k.t = n
e.r = k
n.z = e
n.w = e
n.r = e
assert e.r.x.o.r.txt == "k"