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

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

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

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

j = A("j")
c = B("c")
a = C("a")
h = D("h")
k = B("k")
e = C("e")
g = D("g")
i = C("i")

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

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

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

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

j = A("j")
c = B("c")
a = C("a")
h = D("h")
k = B("k")
e = C("e")
g = D("g")
i = C("i")

j.s = c
j.w = i
j.y = i
c.y = k
c.u = g
c.q = j
a.w = h
a.u = e
a.o = j
h.p = a
h.s = j
k.y = c
k.u = g
k.q = j
e.w = g
e.u = i
e.o = j
g.p = i
g.s = j
i.w = g
i.u = a
i.o = j
assert j.w.w.p.o.s.y.txt == "k"