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

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

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

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

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

n = A("n")
a = B("a")
l = C("l")
h = D("h")
b = E("b")
i = D("i")
m = D("m")

n.v = l
n.t = m
a.p = b
a.t = l
l.q = b
l.u = b
h.s = a
h.v = a
h.t = n
h.w = n
b.s = i
b.t = a
i.s = a
i.v = a
i.t = n
i.w = n
m.s = a
m.v = a
m.t = n
m.w = n
assert n.v.q.s.s.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: D = None
        self.txt = txt

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

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

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

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

n = A("n")
a = B("a")
l = C("l")
h = D("h")
b = E("b")
i = D("i")
m = D("m")

n.v = l
n.t = m
a.p = b
a.t = l
l.q = b
l.u = b
h.s = a
h.v = a
h.t = n
h.w = n
b.s = i
b.t = a
i.s = a
i.v = a
i.t = n
i.w = n
m.s = a
m.v = a
m.t = n
m.w = n
assert n.v.q.s.s.t.u.txt == "b"