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

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

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

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

f = A("f")
b = B("b")
g = C("g")
c = D("c")
a = D("a")
i = C("i")
j = A("j")
k = D("k")
d = A("d")

f.s = a
f.y = b
f.w = b
b.u = f
g.x = j
g.q = b
g.o = i
c.x = j
c.w = b
a.x = j
a.w = b
i.x = j
i.q = b
i.o = g
j.s = a
j.y = b
j.w = b
k.x = d
k.w = b
d.s = k
d.y = b
d.w = b
assert f.s.w.u.y.u.s.x.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: B = None
        self.w: B = None
        self.txt = txt

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

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

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

f = A("f")
b = B("b")
g = C("g")
c = D("c")
a = D("a")
i = C("i")
j = A("j")
k = D("k")
d = A("d")

f.s = a
f.y = b
f.w = b
b.u = f
g.x = j
g.q = b
g.o = i
c.x = j
c.w = b
a.x = j
a.w = b
i.x = j
i.q = b
i.o = g
j.s = a
j.y = b
j.w = b
k.x = d
k.w = b
d.s = k
d.y = b
d.w = b
assert f.s.w.u.y.u.s.x.s.txt == "a"