class A:
    def __init__(self, txt: str):
        self.y: J = None
        self.z: F = None
        self.o: C = None
        self.u: G = None
        self.v: E = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: J = None
        self.z: C = None
        self.x: C = None
        self.r: G = None
        self.v: C = None
        self.t: E = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: I = None
        self.r: A = None
        self.u: G = None
        self.z: G = None
        self.x: A = None
        self.p: A = None
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: H = None
        self.p: H = None
        self.s: J = None
        self.w: H = None
        self.x: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: F = None
        self.r: A = None
        self.t: D = None
        self.x: C = None
        self.q: F = None
        self.z: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: J = None
        self.v: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: J = None
        self.z: C = None
        self.x: C = None
        self.r: G = None
        self.v: C = None
        self.t: E = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: I = None
        self.r: A = None
        self.u: G = None
        self.z: G = None
        self.x: A = None
        self.p: A = None
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: H = None
        self.p: H = None
        self.s: J = None
        self.w: H = None
        self.x: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: F = None
        self.r: A = None
        self.t: D = None
        self.x: C = None
        self.q: F = None
        self.z: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: J = None
        self.v: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: B = None
        self.txt = txt

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

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