class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: E = None
        self.w: A = None
        self.t: D = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

f.s = h
f.v = g
f.q = g
f.w = c
f.t = l
n.v = i
n.p = h
n.s = h
n.o = l
h.p = g
l.w = d
l.q = h
l.p = k
g.t = k
g.p = l
g.u = l
g.s = i
i.w = n
i.q = h
i.p = g
d.v = i
d.o = i
d.p = h
d.s = h
c.s = h
c.v = k
c.w = f
c.t = i
c.q = g
k.t = g
k.p = l
k.u = l
k.s = i
assert d.v.q.p.u.q.p.s.txt == "i"