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

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

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

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

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

k.s = j
k.y = j
k.o = h
h.v = b
h.y = b
h.s = b
h.w = j
e.z = d
e.p = j
e.o = b
j.w = e
j.o = h
j.s = d
d.z = e
d.p = b
d.o = j
b.w = d
b.o = h
b.s = e
l.s = j
l.y = j
l.o = h
assert k.o.w.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: D = None
        self.o: B = None
        self.txt = txt

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

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

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

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

k.s = j
k.y = j
k.o = h
h.v = b
h.y = b
h.s = b
h.w = j
e.z = d
e.p = j
e.o = b
j.w = e
j.o = h
j.s = d
d.z = e
d.p = b
d.o = j
b.w = d
b.o = h
b.s = e
l.s = j
l.y = j
l.o = h
assert k.o.w.w.o.txt == "b"