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

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

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

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

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

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

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

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

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

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

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

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

i.u = f
i.t = n
i.o = h
c.o = i
c.p = g
c.u = h
c.w = b
a.o = i
a.u = g
a.v = n
a.y = n
a.z = c
b.p = g
b.z = c
b.q = c
b.s = h
b.u = i
h.q = a
h.s = n
h.p = c
h.w = b
f.u = i
f.t = a
f.o = h
g.q = n
g.s = a
g.p = c
g.w = b
n.o = i
n.u = g
n.v = a
n.y = a
n.z = c
assert n.z.w.s.p.u.p.p.w.txt == "b"