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

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

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

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

c = A("c")
e = B("e")
m = C("m")
h = D("h")
k = A("k")
j = A("j")
g = C("g")
l = B("l")

c.w = e
c.u = h
c.o = m
c.q = g
e.w = k
m.y = h
h.s = k
h.o = g
k.w = e
k.u = h
k.o = g
k.q = m
j.w = e
j.u = h
j.o = g
j.q = m
g.y = h
l.w = k
assert h.o.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: D = None
        self.o: C = None
        self.q: C = None
        self.txt = txt

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

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

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

c = A("c")
e = B("e")
m = C("m")
h = D("h")
k = A("k")
j = A("j")
g = C("g")
l = B("l")

c.w = e
c.u = h
c.o = m
c.q = g
e.w = k
m.y = h
h.s = k
h.o = g
k.w = e
k.u = h
k.o = g
k.q = m
j.w = e
j.u = h
j.o = g
j.q = m
g.y = h
l.w = k
assert h.o.y.s.txt == "k"