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

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

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: A = None
        self.s: A = None
        self.z: C = None
        self.txt = txt

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

f = A("f")
k = B("k")
b = C("b")
h = D("h")
d = B("d")
i = C("i")
l = C("l")
e = A("e")

f.w = e
f.x = h
f.o = h
k.z = b
k.y = d
k.v = l
k.s = e
b.x = i
b.r = f
b.s = e
b.z = l
h.t = b
h.w = d
h.q = f
d.z = l
d.v = l
d.y = k
d.s = e
i.x = b
i.z = b
i.r = e
i.s = f
l.x = b
l.z = b
l.r = f
l.s = e
e.w = f
e.x = h
e.o = h
assert d.y.s.o.w.s.x.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: D = None
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: A = None
        self.s: A = None
        self.z: C = None
        self.txt = txt

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

f = A("f")
k = B("k")
b = C("b")
h = D("h")
d = B("d")
i = C("i")
l = C("l")
e = A("e")

f.w = e
f.x = h
f.o = h
k.z = b
k.y = d
k.v = l
k.s = e
b.x = i
b.r = f
b.s = e
b.z = l
h.t = b
h.w = d
h.q = f
d.z = l
d.v = l
d.y = k
d.s = e
i.x = b
i.z = b
i.r = e
i.s = f
l.x = b
l.z = b
l.r = f
l.s = e
e.w = f
e.x = h
e.o = h
assert d.y.s.o.w.s.x.t.z.txt == "l"