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

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: E = None
        self.z: B = None
        self.q: B = None
        self.y: E = None
        self.txt = txt

n = A("n")
l = B("l")
f = C("f")
m = D("m")
g = E("g")
h = F("h")
a = B("a")
j = B("j")
b = F("b")
d = A("d")

n.z = g
n.v = f
l.p = g
l.o = g
l.x = g
l.v = d
l.y = d
l.z = n
f.y = n
f.t = b
f.q = g
m.z = a
g.o = m
h.v = g
h.t = g
h.y = g
h.z = j
h.q = a
a.p = g
a.o = g
a.x = g
a.v = n
a.z = d
a.y = d
j.p = g
j.o = g
j.x = g
j.v = n
j.z = n
j.y = d
b.v = g
b.t = g
b.y = g
b.z = a
b.q = j
d.z = g
d.v = f
assert m.z.y.z.o.z.v.v.y.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: E = None
        self.z: B = None
        self.q: B = None
        self.y: E = None
        self.txt = txt

n = A("n")
l = B("l")
f = C("f")
m = D("m")
g = E("g")
h = F("h")
a = B("a")
j = B("j")
b = F("b")
d = A("d")

n.z = g
n.v = f
l.p = g
l.o = g
l.x = g
l.v = d
l.y = d
l.z = n
f.y = n
f.t = b
f.q = g
m.z = a
g.o = m
h.v = g
h.t = g
h.y = g
h.z = j
h.q = a
a.p = g
a.o = g
a.x = g
a.v = n
a.z = d
a.y = d
j.p = g
j.o = g
j.x = g
j.v = n
j.z = n
j.y = d
b.v = g
b.t = g
b.y = g
b.z = a
b.q = j
d.z = g
d.v = f
assert m.z.y.z.o.z.v.v.y.z.o.txt == "m"