class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: G = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: F = None
        self.r: B = None
        self.u: E = None
        self.w: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: E = None
        self.v: C = None
        self.z: B = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: E = None
        self.t: C = None
        self.w: H = None
        self.v: F = None
        self.u: G = None
        self.x: A = None
        self.p: C = None
        self.y: I = None
        self.o: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: F = None
        self.r: B = None
        self.u: E = None
        self.w: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: E = None
        self.v: C = None
        self.z: B = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: E = None
        self.t: C = None
        self.w: H = None
        self.v: F = None
        self.u: G = None
        self.x: A = None
        self.p: C = None
        self.y: I = None
        self.o: B = None
        self.txt = txt

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

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