class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: F = None
        self.s: B = None
        self.y: D = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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