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

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

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

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

j = A("j")
k = B("k")
c = C("c")
e = D("e")
n = D("n")
m = B("m")
a = B("a")

j.s = n
j.o = e
k.u = c
k.o = j
k.p = m
k.v = n
c.x = n
c.t = n
e.u = k
e.x = c
e.r = n
e.w = j
n.u = k
n.x = c
n.r = e
n.w = j
m.u = c
m.o = j
m.p = k
m.v = n
a.u = c
a.o = j
a.p = k
a.v = n
assert e.w.s.w.s.u.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: D = None
        self.txt = txt

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

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

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

j = A("j")
k = B("k")
c = C("c")
e = D("e")
n = D("n")
m = B("m")
a = B("a")

j.s = n
j.o = e
k.u = c
k.o = j
k.p = m
k.v = n
c.x = n
c.t = n
e.u = k
e.x = c
e.r = n
e.w = j
n.u = k
n.x = c
n.r = e
n.w = j
m.u = c
m.o = j
m.p = k
m.v = n
a.u = c
a.o = j
a.p = k
a.v = n
assert e.w.s.w.s.u.v.u.txt == "k"