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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: E = None
        self.txt = txt

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

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

j.s = i
c.s = j
c.w = j
i.w = b
i.q = j
i.o = e
i.s = n
e.y = c
e.o = n
n.y = g
n.u = j
n.v = a
n.x = a
n.r = c
k.y = c
k.o = n
d.y = n
d.u = b
d.v = i
d.x = i
d.r = c
a.w = b
a.q = b
a.o = k
a.s = n
g.y = n
g.u = b
g.v = a
g.x = i
g.r = c
b.s = a
assert a.q.s.o.y.s.s.w.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: E = None
        self.txt = txt

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

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

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