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

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

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

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

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

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

g.s = m
g.r = m
g.v = i
g.u = n
g.x = e
f.p = c
f.o = m
m.o = e
m.q = c
m.v = c
m.u = f
e.s = c
e.p = c
i.p = n
i.u = f
b.p = c
b.o = m
c.s = m
c.r = m
c.v = n
c.u = i
c.x = e
n.p = i
n.u = f
assert m.v.v.p.u.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: C = None
        self.v: E = None
        self.u: E = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

g.s = m
g.r = m
g.v = i
g.u = n
g.x = e
f.p = c
f.o = m
m.o = e
m.q = c
m.v = c
m.u = f
e.s = c
e.p = c
i.p = n
i.u = f
b.p = c
b.o = m
c.s = m
c.r = m
c.v = n
c.u = i
c.x = e
n.p = i
n.u = f
assert m.v.v.p.u.p.r.txt == "m"