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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: F = None
        self.w: A = None
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: B = None
        self.u: D = None
        self.z: C = None
        self.txt = txt

n = A("n")
e = B("e")
a = C("a")
j = D("j")
i = E("i")
m = F("m")
f = E("f")
c = E("c")

n.q = a
e.v = i
e.u = a
e.t = a
a.z = c
j.t = c
j.o = c
j.r = m
j.w = n
i.p = e
i.o = m
i.w = a
m.x = n
m.y = e
m.u = j
m.z = a
f.p = e
f.o = m
f.w = a
c.p = e
c.o = m
c.w = a
assert m.z.z.o.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: F = None
        self.w: A = None
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: B = None
        self.u: D = None
        self.z: C = None
        self.txt = txt

n = A("n")
e = B("e")
a = C("a")
j = D("j")
i = E("i")
m = F("m")
f = E("f")
c = E("c")

n.q = a
e.v = i
e.u = a
e.t = a
a.z = c
j.t = c
j.o = c
j.r = m
j.w = n
i.p = e
i.o = m
i.w = a
m.x = n
m.y = e
m.u = j
m.z = a
f.p = e
f.o = m
f.w = a
c.p = e
c.o = m
c.w = a
assert m.z.z.o.x.q.txt == "a"