class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: D = None
        self.p: I = None
        self.r: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: C = None
        self.t: I = None
        self.o: E = None
        self.p: E = None
        self.y: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: D = None
        self.v: G = None
        self.w: D = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: J = None
        self.o: J = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: C = None
        self.t: I = None
        self.o: E = None
        self.p: E = None
        self.y: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: D = None
        self.v: G = None
        self.w: D = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: J = None
        self.o: J = None
        self.txt = txt

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

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

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