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

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

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

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

j = A("j")
a = B("a")
c = C("c")
l = D("l")
f = B("f")
i = A("i")
h = C("h")

j.w = l
j.s = a
a.r = l
a.u = c
a.t = c
a.y = i
c.o = j
c.w = a
c.v = a
c.p = f
l.z = j
f.r = l
f.u = c
f.t = h
f.y = j
i.w = l
i.s = f
h.o = i
h.w = f
h.p = f
h.v = a
assert a.t.w.t.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: B = None
        self.txt = txt

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

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

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

j = A("j")
a = B("a")
c = C("c")
l = D("l")
f = B("f")
i = A("i")
h = C("h")

j.w = l
j.s = a
a.r = l
a.u = c
a.t = c
a.y = i
c.o = j
c.w = a
c.v = a
c.p = f
l.z = j
f.r = l
f.u = c
f.t = h
f.y = j
i.w = l
i.s = f
h.o = i
h.w = f
h.p = f
h.v = a
assert a.t.w.t.o.s.txt == "a"