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

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

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

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

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

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

n.u = c
l.o = g
a.p = b
a.r = e
a.y = l
a.o = n
c.t = e
c.s = g
c.w = l
g.x = e
g.o = a
g.v = b
g.u = c
e.x = g
e.o = h
e.v = l
e.u = c
h.p = b
h.y = b
h.r = g
h.o = n
b.o = g
assert l.o.o.o.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

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

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

n.u = c
l.o = g
a.p = b
a.r = e
a.y = l
a.o = n
c.t = e
c.s = g
c.w = l
g.x = e
g.o = a
g.v = b
g.u = c
e.x = g
e.o = h
e.v = l
e.u = c
h.p = b
h.y = b
h.r = g
h.o = n
b.o = g
assert l.o.o.o.u.t.txt == "e"