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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: H = None
        self.v: G = None
        self.t: E = None
        self.q: I = None
        self.w: D = None
        self.s: C = None
        self.y: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: A = None
        self.z: J = None
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: D = None
        self.q: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: G = None
        self.q: H = None
        self.y: G = None
        self.s: B = None
        self.x: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: H = None
        self.v: G = None
        self.t: E = None
        self.q: I = None
        self.w: D = None
        self.s: C = None
        self.y: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: A = None
        self.z: J = None
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: D = None
        self.q: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: G = None
        self.q: H = None
        self.y: G = None
        self.s: B = None
        self.x: A = None
        self.txt = txt

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

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

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