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

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

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

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

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

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

n.t = j
n.u = g
n.p = g
l.o = g
l.r = n
l.t = c
d.t = l
d.z = a
d.s = e
j.u = a
j.t = n
j.y = n
a.s = j
a.y = j
a.z = e
c.t = e
c.z = g
c.s = l
g.s = j
g.y = j
g.z = e
e.o = g
e.r = n
e.t = d
assert e.r.p.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: E = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

n.t = j
n.u = g
n.p = g
l.o = g
l.r = n
l.t = c
d.t = l
d.z = a
d.s = e
j.u = a
j.t = n
j.y = n
a.s = j
a.y = j
a.z = e
c.t = e
c.z = g
c.s = l
g.s = j
g.y = j
g.z = e
e.o = g
e.r = n
e.t = d
assert e.r.p.s.u.txt == "a"