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

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

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

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

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

a.o = e
a.r = c
n.p = g
n.y = a
n.t = e
e.v = a
e.y = j
e.w = i
c.y = g
c.s = a
c.z = h
k.v = a
k.y = d
k.w = i
i.y = n
i.s = a
i.z = h
d.v = a
d.y = k
d.w = i
g.p = h
g.y = a
g.t = j
h.p = g
h.y = a
h.t = e
j.v = a
j.y = e
j.w = i
assert j.y.w.y.t.w.s.r.y.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: D = None
        self.txt = txt

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

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

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

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

a.o = e
a.r = c
n.p = g
n.y = a
n.t = e
e.v = a
e.y = j
e.w = i
c.y = g
c.s = a
c.z = h
k.v = a
k.y = d
k.w = i
i.y = n
i.s = a
i.z = h
d.v = a
d.y = k
d.w = i
g.p = h
g.y = a
g.t = j
h.p = g
h.y = a
h.t = e
j.v = a
j.y = e
j.w = i
assert j.y.w.y.t.w.s.r.y.p.t.txt == "e"