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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.s: A = None
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: F = None
        self.x: B = None
        self.v: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.s: A = None
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: F = None
        self.x: B = None
        self.v: D = None
        self.txt = txt

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

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