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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: E = None
        self.o: E = None
        self.x: A = None
        self.txt = txt

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

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

n.q = m
n.v = m
n.y = m
k.o = e
k.v = c
f.p = n
f.s = b
l.z = n
l.v = g
l.o = c
l.x = m
c.w = b
c.q = b
m.q = n
m.v = n
m.y = n
g.w = b
g.q = b
e.z = m
e.v = c
e.o = c
e.x = n
b.p = n
b.s = f
h.z = m
h.v = g
h.o = c
h.x = n
assert f.p.y.v.q.v.q.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: A = None
        self.y: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: E = None
        self.o: E = None
        self.x: A = None
        self.txt = txt

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

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

n.q = m
n.v = m
n.y = m
k.o = e
k.v = c
f.p = n
f.s = b
l.z = n
l.v = g
l.o = c
l.x = m
c.w = b
c.q = b
m.q = n
m.v = n
m.y = n
g.w = b
g.q = b
e.z = m
e.v = c
e.o = c
e.x = n
b.p = n
b.s = f
h.z = m
h.v = g
h.o = c
h.x = n
assert f.p.y.v.q.v.q.y.y.txt == "m"