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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: D = None
        self.txt = txt

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

n.v = f
n.w = a
n.o = i
n.s = e
a.q = c
a.r = l
i.u = n
i.w = e
i.y = c
i.s = l
e.s = g
e.y = n
e.p = f
j.p = h
j.q = f
l.u = n
l.w = f
l.y = g
l.s = i
h.p = j
h.q = e
g.q = c
g.r = i
c.q = a
c.r = i
f.s = a
f.y = n
f.p = e
assert l.s.y.r.u.o.y.q.r.u.txt == "n"