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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: D = None
        self.u: E = None
        self.t: A = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: B = None
        self.z: D = None
        self.w: A = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: A = None
        self.r: F = None
        self.txt = txt

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

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

n.o = d
n.q = k
n.w = m
n.r = i
i.r = j
i.u = j
i.p = j
i.q = c
i.t = n
a.y = h
a.p = i
a.z = c
a.w = n
a.q = m
c.s = a
c.r = i
j.q = n
j.u = h
j.r = k
k.z = d
k.p = c
k.q = h
k.s = j
h.o = a
h.q = k
h.w = m
h.r = i
m.r = j
m.u = j
m.p = j
m.q = c
m.t = n
d.y = n
d.p = m
d.q = m
d.z = c
d.w = h
assert m.q.s.y.o.q.t.w.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: F = None
        self.w: B = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: D = None
        self.u: E = None
        self.t: A = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: B = None
        self.z: D = None
        self.w: A = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: A = None
        self.r: F = None
        self.txt = txt

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

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

n.o = d
n.q = k
n.w = m
n.r = i
i.r = j
i.u = j
i.p = j
i.q = c
i.t = n
a.y = h
a.p = i
a.z = c
a.w = n
a.q = m
c.s = a
c.r = i
j.q = n
j.u = h
j.r = k
k.z = d
k.p = c
k.q = h
k.s = j
h.o = a
h.q = k
h.w = m
h.r = i
m.r = j
m.u = j
m.p = j
m.q = c
m.t = n
d.y = n
d.p = m
d.q = m
d.z = c
d.w = h
assert m.q.s.y.o.q.t.w.p.q.txt == "n"