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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: A = None
        self.p: B = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: A = None
        self.p: B = None
        self.r: C = None
        self.txt = txt

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

c.v = h
c.r = i
c.p = e
e.v = m
m.r = l
m.w = h
m.u = f
m.p = e
i.q = n
l.t = m
l.r = m
l.q = d
l.p = e
h.t = m
h.r = m
h.q = d
h.p = g
f.q = i
n.q = i
g.v = m
d.v = h
d.r = i
d.p = e
assert e.v.u.q.txt == "i"