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

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

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

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

g = A("g")
h = B("h")
k = C("k")
e = D("e")

g.x = e
g.w = e
g.y = k
g.v = h
h.q = e
h.o = k
h.v = k
h.y = k
k.r = h
k.p = h
k.w = g
e.s = h
e.x = k
assert g.y.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: D = None
        self.y: C = None
        self.v: B = None
        self.txt = txt

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

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

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

g = A("g")
h = B("h")
k = C("k")
e = D("e")

g.x = e
g.w = e
g.y = k
g.v = h
h.q = e
h.o = k
h.v = k
h.y = k
k.r = h
k.p = h
k.w = g
e.s = h
e.x = k
assert g.y.w.w.txt == "e"