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

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

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

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

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

b = A("b")
e = B("e")
i = C("i")
k = D("k")
g = E("g")
a = E("a")
n = C("n")
h = D("h")

b.q = n
b.p = k
b.z = a
e.s = a
e.z = h
e.u = b
i.v = n
i.o = a
i.z = h
k.p = e
k.o = e
k.z = b
g.y = n
g.x = h
g.q = a
g.p = b
a.y = i
a.x = k
a.q = g
a.p = b
n.v = i
n.o = a
n.z = h
h.p = e
h.o = e
h.z = b
assert n.o.q.y.v.z.p.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: D = None
        self.z: E = None
        self.txt = txt

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

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

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

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

b = A("b")
e = B("e")
i = C("i")
k = D("k")
g = E("g")
a = E("a")
n = C("n")
h = D("h")

b.q = n
b.p = k
b.z = a
e.s = a
e.z = h
e.u = b
i.v = n
i.o = a
i.z = h
k.p = e
k.o = e
k.z = b
g.y = n
g.x = h
g.q = a
g.p = b
a.y = i
a.x = k
a.q = g
a.p = b
n.v = i
n.o = a
n.z = h
h.p = e
h.o = e
h.z = b
assert n.o.q.y.v.z.p.u.q.txt == "n"