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

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

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

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

g = A("g")
m = B("m")
b = C("b")
a = D("a")
k = A("k")
e = D("e")
f = A("f")
h = C("h")
j = D("j")
i = B("i")

g.w = e
g.s = k
m.u = j
m.s = e
m.y = f
b.v = m
b.y = h
b.u = h
a.t = e
k.w = a
k.s = f
e.t = j
f.w = e
f.s = g
h.v = i
h.y = b
h.u = b
j.t = e
i.u = a
i.s = a
i.y = k
assert b.y.v.y.s.s.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: A = None
        self.txt = txt

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

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

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

g = A("g")
m = B("m")
b = C("b")
a = D("a")
k = A("k")
e = D("e")
f = A("f")
h = C("h")
j = D("j")
i = B("i")

g.w = e
g.s = k
m.u = j
m.s = e
m.y = f
b.v = m
b.y = h
b.u = h
a.t = e
k.w = a
k.s = f
e.t = j
f.w = e
f.s = g
h.v = i
h.y = b
h.u = b
j.t = e
i.u = a
i.s = a
i.y = k
assert b.y.v.y.s.s.w.t.txt == "j"