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

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

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

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

c = A("c")
k = B("k")
l = C("l")
b = D("b")

c.y = b
c.o = k
c.p = k
k.o = b
k.u = l
k.s = c
l.y = c
l.o = c
b.y = c
b.w = c
b.r = l
assert c.o.u.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: B = None
        self.p: B = None
        self.txt = txt

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

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

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

c = A("c")
k = B("k")
l = C("l")
b = D("b")

c.y = b
c.o = k
c.p = k
k.o = b
k.u = l
k.s = c
l.y = c
l.o = c
b.y = c
b.w = c
b.r = l
assert c.o.u.y.p.txt == "k"