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

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

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

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

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

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

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

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

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

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

e.s = j
e.o = f
e.x = h
e.w = i
a.q = i
a.u = g
a.o = k
i.q = j
h.w = k
h.r = k
h.v = e
f.q = i
f.u = g
f.o = k
n.w = i
n.r = k
n.v = e
j.s = e
j.o = f
j.x = n
j.w = k
g.q = k
g.u = a
g.o = i
k.q = j
assert n.v.w.q.x.v.w.q.w.q.txt == "j"