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

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

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: B = None
        self.u: B = None
        self.txt = txt

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

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

i = A("i")
j = B("j")
e = C("e")
b = D("b")
a = E("a")
l = A("l")
n = E("n")
m = C("m")
f = B("f")

i.u = j
i.v = b
i.w = a
i.q = n
i.p = n
j.u = i
e.x = m
e.s = f
e.u = j
b.q = e
b.p = l
b.w = m
a.y = e
l.u = j
l.v = b
l.w = n
l.q = n
l.p = n
n.y = m
m.x = e
m.s = f
m.u = j
f.u = l
assert n.y.x.s.u.u.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: D = None
        self.w: E = None
        self.q: E = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: B = None
        self.u: B = None
        self.txt = txt

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

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

i = A("i")
j = B("j")
e = C("e")
b = D("b")
a = E("a")
l = A("l")
n = E("n")
m = C("m")
f = B("f")

i.u = j
i.v = b
i.w = a
i.q = n
i.p = n
j.u = i
e.x = m
e.s = f
e.u = j
b.q = e
b.p = l
b.w = m
a.y = e
l.u = j
l.v = b
l.w = n
l.q = n
l.p = n
n.y = m
m.x = e
m.s = f
m.u = j
f.u = l
assert n.y.x.s.u.u.u.w.txt == "a"