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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: B = None
        self.s: A = None
        self.o: B = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: B = None
        self.s: A = None
        self.o: B = None
        self.r: D = None
        self.txt = txt

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

n.y = c
n.u = c
n.z = d
n.q = g
l.p = c
l.x = a
l.r = m
l.u = f
l.q = d
f.x = l
m.t = n
m.q = g
m.y = d
m.z = l
m.p = c
m.x = a
c.r = a
c.q = l
c.w = l
c.u = n
c.t = n
a.w = l
a.o = l
a.u = g
a.s = n
a.r = h
g.p = c
g.x = a
g.r = h
g.u = f
g.q = d
d.w = g
d.u = l
d.o = l
d.s = n
d.r = m
h.t = n
h.q = l
h.z = l
h.y = d
h.p = c
h.x = a
assert n.q.x.s.txt == "n"