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

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

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

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

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

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

c.q = h
k.t = c
k.v = i
k.p = f
k.o = g
m.w = n
m.r = l
m.p = f
m.o = k
m.x = c
h.p = k
h.x = k
h.o = n
h.v = m
f.p = c
f.u = c
f.z = k
l.p = g
l.x = k
l.o = n
l.v = n
i.p = k
i.x = k
i.o = m
i.v = n
g.t = c
g.v = h
g.p = a
g.o = k
n.w = m
n.r = h
n.p = a
n.o = g
n.x = c
a.p = c
a.u = c
a.z = k
assert f.u.q.p.t.q.o.w.w.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

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

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

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

c.q = h
k.t = c
k.v = i
k.p = f
k.o = g
m.w = n
m.r = l
m.p = f
m.o = k
m.x = c
h.p = k
h.x = k
h.o = n
h.v = m
f.p = c
f.u = c
f.z = k
l.p = g
l.x = k
l.o = n
l.v = n
i.p = k
i.x = k
i.o = m
i.v = n
g.t = c
g.v = h
g.p = a
g.o = k
n.w = m
n.r = h
n.p = a
n.o = g
n.x = c
a.p = c
a.u = c
a.z = k
assert f.u.q.p.t.q.o.w.w.p.z.txt == "k"