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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: J = None
        self.x: G = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: B = None
        self.q: F = None
        self.x: F = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: A = None
        self.p: J = None
        self.o: H = None
        self.z: J = None
        self.t: C = None
        self.v: J = None
        self.w: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: G = None
        self.p: A = None
        self.r: J = None
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: E = None
        self.t: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: E = None
        self.s: G = None
        self.o: D = None
        self.p: D = None
        self.x: A = None
        self.w: C = None
        self.r: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: J = None
        self.x: G = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: B = None
        self.q: F = None
        self.x: F = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: A = None
        self.p: J = None
        self.o: H = None
        self.z: J = None
        self.t: C = None
        self.v: J = None
        self.w: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: G = None
        self.p: A = None
        self.r: J = None
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: E = None
        self.t: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: E = None
        self.s: G = None
        self.o: D = None
        self.p: D = None
        self.x: A = None
        self.w: C = None
        self.r: I = None
        self.txt = txt

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

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