class A:
    def __init__(self, txt: str):
        self.w: J = None
        self.t: G = None
        self.x: E = None
        self.o: B = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: F = None
        self.o: H = None
        self.z: A = None
        self.w: A = None
        self.s: E = None
        self.u: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: I = None
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: J = None
        self.x: E = None
        self.u: A = None
        self.r: F = None
        self.s: A = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: I = None
        self.o: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: B = None
        self.t: G = None
        self.p: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: C = None
        self.w: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: F = None
        self.o: H = None
        self.z: A = None
        self.w: A = None
        self.s: E = None
        self.u: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: I = None
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: J = None
        self.x: E = None
        self.u: A = None
        self.r: F = None
        self.s: A = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: I = None
        self.o: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: B = None
        self.t: G = None
        self.p: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: C = None
        self.w: A = None
        self.txt = txt

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

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