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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: A = None
        self.o: C = None
        self.z: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: C = None
        self.z: E = None
        self.w: C = None
        self.s: D = None
        self.q: E = None
        self.txt = txt

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

i.p = h
h.r = n
h.w = e
h.o = c
h.z = j
c.p = m
g.o = m
g.r = c
j.u = i
j.r = g
j.w = g
j.v = c
j.s = e
j.p = m
n.u = i
n.p = c
n.w = c
n.z = j
n.q = j
n.s = g
m.u = e
m.s = e
m.r = g
m.w = g
m.v = c
m.p = j
d.r = n
d.w = e
d.o = c
d.z = j
e.p = h
assert m.v.p.s.p.r.s.o.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: A = None
        self.o: C = None
        self.z: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: C = None
        self.z: E = None
        self.w: C = None
        self.s: D = None
        self.q: E = None
        self.txt = txt

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

i.p = h
h.r = n
h.w = e
h.o = c
h.z = j
c.p = m
g.o = m
g.r = c
j.u = i
j.r = g
j.w = g
j.v = c
j.s = e
j.p = m
n.u = i
n.p = c
n.w = c
n.z = j
n.q = j
n.s = g
m.u = e
m.s = e
m.r = g
m.w = g
m.v = c
m.p = j
d.r = n
d.w = e
d.o = c
d.z = j
e.p = h
assert m.v.p.s.p.r.s.o.p.v.txt == "c"