class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: I = None
        self.x: I = None
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: G = None
        self.w: F = None
        self.t: F = None
        self.p: I = None
        self.o: H = None
        self.q: I = None
        self.s: D = None
        self.x: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: J = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: C = None
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: H = None
        self.y: E = None
        self.v: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: F = None
        self.t: D = None
        self.p: A = None
        self.z: F = None
        self.q: C = None
        self.o: C = None
        self.w: C = None
        self.v: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: D = None
        self.p: F = None
        self.w: I = None
        self.txt = txt

c = A("c")
g = B("g")
n = C("n")
h = D("h")
d = E("d")
l = F("l")
b = G("b")
i = H("i")
a = I("a")
f = J("f")

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: G = None
        self.w: F = None
        self.t: F = None
        self.p: I = None
        self.o: H = None
        self.q: I = None
        self.s: D = None
        self.x: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: J = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: C = None
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: H = None
        self.y: E = None
        self.v: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: F = None
        self.t: D = None
        self.p: A = None
        self.z: F = None
        self.q: C = None
        self.o: C = None
        self.w: C = None
        self.v: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: D = None
        self.p: F = None
        self.w: I = None
        self.txt = txt

c = A("c")
g = B("g")
n = C("n")
h = D("h")
d = E("d")
l = F("l")
b = G("b")
i = H("i")
a = I("a")
f = J("f")

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