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

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

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

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: F = None
        self.u: D = None
        self.q: C = None
        self.x: C = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: F = None
        self.u: D = None
        self.q: C = None
        self.x: C = None
        self.o: D = None
        self.txt = txt

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

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

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