class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: G = None
        self.z: F = None
        self.p: C = None
        self.q: F = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: D = None
        self.q: H = None
        self.r: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: D = None
        self.q: H = None
        self.r: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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

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

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