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

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

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

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

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

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

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

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

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

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

k.t = h
k.o = l
k.y = l
k.p = c
c.w = l
c.u = h
l.o = h
l.x = h
h.s = k
h.v = k
assert c.w.o.v.t.txt == "h"