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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: F = None
        self.t: A = None
        self.p: J = None
        self.w: H = None
        self.u: H = None
        self.v: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: B = None
        self.x: D = None
        self.y: D = None
        self.s: C = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: C = None
        self.o: F = None
        self.r: B = None
        self.y: H = None
        self.x: I = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: F = None
        self.t: A = None
        self.p: J = None
        self.w: H = None
        self.u: H = None
        self.v: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: B = None
        self.x: D = None
        self.y: D = None
        self.s: C = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: C = None
        self.o: F = None
        self.r: B = None
        self.y: H = None
        self.x: I = None
        self.txt = txt

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

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

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

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

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