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

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

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

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

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

c.p = h
c.x = h
c.v = h
l.z = h
l.u = c
h.u = c
h.x = c
h.y = k
h.o = k
k.o = h
k.y = l
assert l.z.x.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: C = None
        self.v: C = None
        self.txt = txt

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

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

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

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

c.p = h
c.x = h
c.v = h
l.z = h
l.u = c
h.u = c
h.x = c
h.y = k
h.o = k
k.o = h
k.y = l
assert l.z.x.v.y.txt == "k"