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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: A = None
        self.v: A = None
        self.z: E = None
        self.txt = txt

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

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

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

n.s = j
n.z = d
n.q = l
n.r = i
i.p = n
h.u = l
h.z = l
h.t = n
h.v = d
j.s = c
j.z = l
j.u = g
l.o = n
l.u = c
d.s = j
d.z = n
d.q = l
d.r = g
g.p = n
c.u = l
c.z = l
c.t = d
c.v = n
assert j.s.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: A = None
        self.q: E = None
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: A = None
        self.v: A = None
        self.z: E = None
        self.txt = txt

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

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

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

n.s = j
n.z = d
n.q = l
n.r = i
i.p = n
h.u = l
h.z = l
h.t = n
h.v = d
j.s = c
j.z = l
j.u = g
l.o = n
l.u = c
d.s = j
d.z = n
d.q = l
d.r = g
g.p = n
c.u = l
c.z = l
c.t = d
c.v = n
assert j.s.u.u.txt == "c"