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

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.q: J = None
        self.y: H = None
        self.p: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: C = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: E = None
        self.v: D = None
        self.w: A = None
        self.s: B = None
        self.u: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: G = None
        self.s: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: C = None
        self.y: H = None
        self.o: F = None
        self.s: H = None
        self.q: G = None
        self.p: D = None
        self.u: I = None
        self.x: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.q: J = None
        self.y: H = None
        self.p: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: C = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: E = None
        self.v: D = None
        self.w: A = None
        self.s: B = None
        self.u: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: G = None
        self.s: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: C = None
        self.y: H = None
        self.o: F = None
        self.s: H = None
        self.q: G = None
        self.p: D = None
        self.u: I = None
        self.x: G = None
        self.txt = txt

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

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