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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: A = None
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.v: A = None
        self.t: F = None
        self.x: A = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: I = None
        self.z: B = None
        self.u: I = None
        self.v: F = None
        self.x: J = None
        self.r: J = None
        self.t: F = None
        self.y: J = None
        self.w: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: E = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: E = None
        self.y: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: F = None
        self.t: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: A = None
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.v: A = None
        self.t: F = None
        self.x: A = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: I = None
        self.z: B = None
        self.u: I = None
        self.v: F = None
        self.x: J = None
        self.r: J = None
        self.t: F = None
        self.y: J = None
        self.w: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: E = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: E = None
        self.y: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: F = None
        self.t: F = None
        self.txt = txt

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

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