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

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

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

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

a = A("a")
l = B("l")
h = C("h")
j = D("j")
b = D("b")
k = A("k")
m = C("m")
i = C("i")

a.w = m
a.y = l
a.t = j
l.u = j
l.x = b
h.o = a
h.w = l
j.y = k
j.q = h
j.s = b
b.y = a
b.q = h
b.s = j
k.w = h
k.y = l
k.t = b
m.o = a
m.w = l
i.o = a
i.w = l
assert k.w.w.u.s.s.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: B = None
        self.t: D = None
        self.txt = txt

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

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

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

a = A("a")
l = B("l")
h = C("h")
j = D("j")
b = D("b")
k = A("k")
m = C("m")
i = C("i")

a.w = m
a.y = l
a.t = j
l.u = j
l.x = b
h.o = a
h.w = l
j.y = k
j.q = h
j.s = b
b.y = a
b.q = h
b.s = j
k.w = h
k.y = l
k.t = b
m.o = a
m.w = l
i.o = a
i.w = l
assert k.w.w.u.s.s.q.w.txt == "l"