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

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

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

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

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

n = A("n")
f = B("f")
g = C("g")
d = D("d")
k = E("k")
j = E("j")
l = D("l")
i = A("i")
b = D("b")
m = C("m")

n.u = f
n.o = g
f.v = k
g.q = d
g.r = m
g.v = f
g.w = l
g.s = i
d.v = i
d.q = l
k.x = b
k.u = b
k.y = m
k.t = n
k.v = j
j.x = b
j.u = b
j.y = m
j.t = n
j.v = k
l.v = i
l.q = b
i.u = f
i.o = m
b.v = n
b.q = l
m.q = b
m.r = g
m.v = f
m.w = l
m.s = n
assert m.r.r.w.v.o.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: C = None
        self.txt = txt

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

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

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

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

n = A("n")
f = B("f")
g = C("g")
d = D("d")
k = E("k")
j = E("j")
l = D("l")
i = A("i")
b = D("b")
m = C("m")

n.u = f
n.o = g
f.v = k
g.q = d
g.r = m
g.v = f
g.w = l
g.s = i
d.v = i
d.q = l
k.x = b
k.u = b
k.y = m
k.t = n
k.v = j
j.x = b
j.u = b
j.y = m
j.t = n
j.v = k
l.v = i
l.q = b
i.u = f
i.o = m
b.v = n
b.q = l
m.q = b
m.r = g
m.v = f
m.w = l
m.s = n
assert m.r.r.w.v.o.r.v.txt == "f"